aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlecs King <alecsk@gmail.com>2005-12-31 15:20:27 +0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-31 11:32:36 -0800
commit9ea30e2aea4877765c8d41e683e3674af575a338 (patch)
tree728462f6c2d05e409a744d770e9ede0c9948a546 /ptrlist.c
parent[PATCH] dissect.c (diff)
downloadsparse-9ea30e2aea4877765c8d41e683e3674af575a338.tar.gz
sparse-9ea30e2aea4877765c8d41e683e3674af575a338.tar.bz2
sparse-9ea30e2aea4877765c8d41e683e3674af575a338.zip
[PATCH] fix a memory leak in pack_ptr_list
Free the last entry when the whole list gets empty. Signed-off-by: Alecs King <alecsk@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ptrlist.c')
-rw-r--r--ptrlist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ptrlist.c b/ptrlist.c
index 14d8416..467a108 100644
--- a/ptrlist.c
+++ b/ptrlist.c
@@ -72,6 +72,7 @@ restart:
if (!entry->nr) {
struct ptr_list *prev;
if (next == entry) {
+ free(entry);
*listp = NULL;
return;
}