projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c5f8d1
)
amqp plugin: prevent use after free
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Wed, 27 Apr 2016 14:18:30 +0000
(16:18 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Wed, 27 Apr 2016 14:18:30 +0000
(16:18 +0200)
Found by scan-build:
amqp.c:1097:13: warning: Use of memory after it is freed
camqp_config_free (conf);
^~~~~~~~~~~~~~~~~~~~~~~~
src/amqp.c
patch
|
blob
|
history
diff --git
a/src/amqp.c
b/src/amqp.c
index
2be55e0
..
fc69e93
100644
(file)
--- 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);
}