From 37c40a63c9990377512c6345a32b3b645d1f29a4 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Sat, 4 Jul 2009 03:22:11 +0000 Subject: [PATCH] Fix issue on "Segmentation fault on package removal" 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libopkg/str_list.c b/libopkg/str_list.c index 563f3a1..f4cc136 100644 --- a/libopkg/str_list.c +++ b/libopkg/str_list.c @@ -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) -- 2.25.1