]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Set pointer to NULL after free
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Sep 2017 19:41:28 +0000 (15:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Sep 2017 19:41:28 +0000 (15:41 -0400)
list_delete does not set the list pointer to NULL
Thus when we accidently use it later we happily write
off into lala land instead of crashing imediately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/thread.c

index d8be32e2bd7bb86e98f5b9226ff4bfa3bfd536d2..ab785087e1b95661ec925f4a9d48e28306cbed5c 100644 (file)
@@ -570,6 +570,7 @@ void thread_master_free(struct thread_master *m)
        close(m->io_pipe[0]);
        close(m->io_pipe[1]);
        list_delete(m->cancel_req);
+       m->cancel_req = NULL;
 
        hash_clean(m->cpu_record, cpu_record_hash_free);
        hash_free(m->cpu_record);