From: Ruben Kerkhof Date: Wed, 27 Apr 2016 14:18:30 +0000 (+0200) Subject: amqp plugin: prevent use after free X-Git-Tag: collectd-5.6.0~311 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=af2f301138fed32705d865ce1c364ceb8ab3ddc7;p=collectd.git amqp plugin: prevent use after free Found by scan-build: amqp.c:1097:13: warning: Use of memory after it is freed camqp_config_free (conf); ^~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/src/amqp.c b/src/amqp.c index 2be55e07..fc69e936 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -737,7 +737,6 @@ static int camqp_subscribe_init (camqp_config_t *conf) /* {{{ */ { ERROR ("amqp plugin: realloc failed."); sfree (subscriber_threads); - camqp_config_free (conf); return (ENOMEM); } subscriber_threads = tmp; @@ -751,7 +750,6 @@ static int camqp_subscribe_init (camqp_config_t *conf) /* {{{ */ char errbuf[1024]; ERROR ("amqp plugin: pthread_create failed: %s", sstrerror (status, errbuf, sizeof (errbuf))); - camqp_config_free (conf); return (status); }