Przeglądaj źródła

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

Daniel-Constantin Mierla 11 lat temu
rodzic
commit
71332ed9ce
1 zmienionych plików z 2 dodań i 0 usunięć
  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;
 		}