summaryrefslogtreecommitdiffstats
path: root/libopkg/void_list.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:26:51 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:26:51 (EST)
commitb70dc315e405d3c59dae2a795462f85d02cbb8df (patch)
tree32bd52b0db1901e262e637dc3f2f93e746a38df6 /libopkg/void_list.c
parent6b7a2a530a5fdd990264466882528c9db8c6ae0b (diff)
opkg: fix the crashing issue.
It's a hanging pointer. Using installed_files without get and free git-svn-id: http://opkg.googlecode.com/svn/trunk@144 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/void_list.c')
-rw-r--r--libopkg/void_list.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libopkg/void_list.c b/libopkg/void_list.c
index f749016..8d61fbb 100644
--- a/libopkg/void_list.c
+++ b/libopkg/void_list.c
@@ -160,6 +160,15 @@ void *void_list_remove_elt(void_list_t *list, const void *target_data, void_list
void_list_elt_t *old_elt = NULL;
void *old_data = NULL;
+ if (!list) {
+ fprintf(stderr, "Error: void_list_remove_elt list is NULL\n");
+ return NULL;
+ }
+ if (!target_data) {
+ fprintf(stderr, "Error: void_list_remove_elt target_data is NULL\n");
+ return NULL;
+ }
+
/* first element */
if (list->head && list->head->data && (cmp(list->head->data, target_data) == 0)) {
old_elt = list->head;