]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: Free pidlist entries after removed from the list
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 27 Aug 2010 17:40:23 +0000 (20:40 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 27 Aug 2010 17:40:23 +0000 (20:40 +0300)
Since there will be no references to the pidlist entries that are
removed from the list, it should be freed as well.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
parse.c

diff --git a/parse.c b/parse.c
index 275da846fd59f792a46c95f0270e79591d25b401..e21935f4543c753ce0b4194e4d9ffe61f8d60a95 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -304,6 +304,7 @@ free:
        list_for_each_entry_safe(pidl, n, &opts->pidlist, list) {
                if (pidl->pid == pid) {
                        list_del(&pidl->list);
        list_for_each_entry_safe(pidl, n, &opts->pidlist, list) {
                if (pidl->pid == pid) {
                        list_del(&pidl->list);
+                       free(pidl);
                        break;
                }
        }
                        break;
                }
        }