commit 1ec0073bb813987a681f33225fdd5780902d99c8
parent c9609ea5ff66f226a2829ab4e00d2b2f8212e3b8
Author: sin <sin@2f30.org>
Date: Thu, 3 Jul 2014 14:24:10 +0100
Remove entries from TAILQ when free-ing
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/killall5.c b/killall5.c
@@ -107,6 +107,7 @@ main(int argc, char *argv[])
for (pe = TAILQ_FIRST(&omitpid_head); pe; pe = tmp) {
tmp = TAILQ_NEXT(pe, entry);
+ TAILQ_REMOVE(&omitpid_head, pe, entry);
free(pe);
}
diff --git a/pidof.c b/pidof.c
@@ -109,6 +109,7 @@ out:
for (pe = TAILQ_FIRST(&omitpid_head); pe; pe = tmp) {
tmp = TAILQ_NEXT(pe, entry);
+ TAILQ_REMOVE(&omitpid_head, pe, entry);
free(pe);
}