projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f22e31f
)
network: Add missing freeaddrinfo on error path.
author
Ryan McCabe
<rmccabe@redhat.com>
Wed, 4 Dec 2019 15:33:55 +0000
(10:33 -0500)
committer
Ryan McCabe
<rmccabe@redhat.com>
Wed, 4 Dec 2019 15:33:55 +0000
(10:33 -0500)
Add a missing freeaddrinfo on an error path to fix a memory leak
in the network code.
Changelog: network: Fix memory leak.
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
src/network.c
patch
|
blob
|
history
diff --git
a/src/network.c
b/src/network.c
index
a1a6e3d
..
613caa7
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-2762,6
+2762,7
@@
network_config_set_bind_address(const oconfig_item_t *ci,
*bind_address = malloc(sizeof(**bind_address));
if (*bind_address == NULL) {
ERROR("network plugin: network_config_set_bind_address: malloc failed.");
+ freeaddrinfo(res);
return -1;
}
(*bind_address)->ss_family = res->ai_family;