[hackers] [ubase] Remove entries from TAILQ when free-ing || sin

From: <git_AT_suckless.org>
Date: Thu, 03 Jul 2014 15:29:52 +0200

commit 1ec0073bb813987a681f33225fdd5780902d99c8
Author: sin <sin_AT_2f30.org>
Date: Thu Jul 3 14:24:10 2014 +0100

    Remove entries from TAILQ when free-ing

diff --git a/killall5.c b/killall5.c
index 406ddb5..9a0b606 100644
--- a/killall5.c
+++ b/killall5.c
_AT_@ -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
index 4ed19c7..5841ed5 100644
--- a/pidof.c
+++ b/pidof.c
_AT_@ -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);
         }
 
Received on Thu Jul 03 2014 - 15:29:52 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 03 2014 - 15:36:04 CEST