From: Dan Fandrich Date: Mon, 4 Feb 2013 22:59:41 +0000 (+0100) Subject: Fix a NULL pointer dereference during shutdown X-Git-Tag: collectd-5.3.0~40 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c9ca810479718e02eeecfda9155f06585a0362fc;p=collectd.git Fix a NULL pointer dereference during shutdown Signed-off-by: Florian Forster --- diff --git a/src/plugin.c b/src/plugin.c index 70372342..942f8bfe 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -810,10 +810,12 @@ static void stop_write_threads (void) /* {{{ */ pthread_mutex_lock (&write_lock); i = 0; - for (q = write_queue_head; q != NULL; q = q->next) + for (q = write_queue_head; q != NULL; ) { + write_queue_t *q1 = q; plugin_value_list_free (q->vl); - sfree (q); + q = q->next; + sfree (q1); i++; } write_queue_head = NULL;