Remove entries from TAILQ when free-ing

This commit is contained in:
sin 2014-07-03 14:24:10 +01:00
parent c9609ea5ff
commit 1ec0073bb8
2 changed files with 2 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);
}