summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-03-09 19:14:37 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-03-09 19:14:37 +0000
commitd7c1b5874dcb3b4242c8d905255cf3c07cd7f877 (patch)
tree55859b842c88f17787063fb667f6458860252b58 /common
parent54dc459770b50d014b9d7eae037578086a29a535 (diff)
Fix memory leak in list.c
Diffstat (limited to 'common')
-rw-r--r--common/list.c5
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;
}