Fix issue on "Segmentation fault on package removal"
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sat, 4 Jul 2009 03:22:11 +0000 (03:22 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sat, 4 Jul 2009 03:22:11 +0000 (03:22 +0000)
Thanks to http://code.google.com/u/kosmaty/
Find the issue and fix it.

http://code.google.com/p/opkg/issues/detail?id=13

git-svn-id: http://opkg.googlecode.com/svn/trunk@215 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/str_list.c

index 563f3a144315c6d9ec6ed3617e2832ef38c7bac3..f4cc136cb9a00415cef4d2951c8d8f9feaa6ff17 100644 (file)
@@ -75,10 +75,11 @@ str_list_elt_t *str_list_pop(str_list_t *list)
 
 void str_list_remove(str_list_t *list, str_list_elt_t **iter)
 {
-    str_list_elt_t * elt = void_list_remove((void_list_t *) list,
+    char *str = void_list_remove((void_list_t *) list,
                                               (void_list_elt_t **) iter);
 
-    str_list_elt_deinit(elt);
+    if (str) 
+       free(str);
 }
 
 void str_list_remove_elt(str_list_t *list, const char *target_str)