From: Florian Forster Date: Thu, 9 Oct 2008 06:43:20 +0000 (+0200) Subject: network plugin: Fix a minor memory leak. X-Git-Tag: collectd-4.4.4~10 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=086b9ef44986f157c627aafd17ad4ad640db9c6c network plugin: Fix a minor memory leak. Thanks to Niraj Tolia for reporting this :) --- diff --git a/src/network.c b/src/network.c index 0f558ca9..0ea51b3b 100644 --- a/src/network.c +++ b/src/network.c @@ -1550,7 +1550,10 @@ static int network_config (const char *key, const char *val) fields_num = strsplit (val_cpy, fields, 3); if ((fields_num != 1) && (fields_num != 2)) + { + sfree (val_cpy); return (1); + } else if (fields_num == 2) { if ((service = strchr (fields[1], '.')) != NULL) @@ -1563,6 +1566,8 @@ static int network_config (const char *key, const char *val) network_add_listen_socket (node, service); else network_add_sending_socket (node, service); + + sfree (val_cpy); } else if (strcasecmp ("TimeToLive", key) == 0) {