Explorar o código

rls: free item in case of duplicate when trying to add to str list

Daniel-Constantin Mierla %!s(int64=11) %!d(string=hai) anos
pai
achega
71332ed9ce
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      modules/rls/list.h

+ 2 - 0
modules/rls/list.h

@@ -42,6 +42,7 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 	{
 		if (duplicate != NULL)
 			*duplicate = 1;
+		pkg_free(p);
 		return list;
 	}
 	if (cmp > 0)
@@ -59,6 +60,7 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 		{
 			if (duplicate != NULL)
 				*duplicate = 1;
+			pkg_free(p);
 			return list;
 		}