diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-03-09 19:14:37 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-03-09 19:14:37 +0000 |
commit | d7c1b5874dcb3b4242c8d905255cf3c07cd7f877 (patch) | |
tree | 55859b842c88f17787063fb667f6458860252b58 /common | |
parent | 54dc459770b50d014b9d7eae037578086a29a535 (diff) |
Fix memory leak in list.c
Diffstat (limited to 'common')
-rw-r--r-- | common/list.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/list.c b/common/list.c index 1aa9d0be..bda2b564 100644 --- a/common/list.c +++ b/common/list.c @@ -74,13 +74,14 @@ struct slist *slist_remove(struct slist *list, void *data) return list; next = match->next; - match->next = NULL; + + free(match); /* If the head was removed, return the next element */ if (!prev) return next; - prev->next = match->next; + prev->next = next; return list; } |