projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
interface plugin: following active/inactive interfaces via ReportInactive
[collectd.git]
/
src
/
openvpn.c
diff --git
a/src/openvpn.c
b/src/openvpn.c
index
f10b174
..
85760e9
100644
(file)
--- a/
src/openvpn.c
+++ b/
src/openvpn.c
@@
-712,17
+712,19
@@
static int openvpn_config (const char *key, const char *value)
temp->version = status_version;
temp->name = status_name;
temp->version = status_version;
temp->name = status_name;
- vpn_
list = realloc (vpn_list, (vpn_num + 1) * sizeof (vpn_status_t *
));
- if (
vpn
_list == NULL)
+ vpn_
status_t **tmp_list = realloc (vpn_list, (vpn_num + 1) * sizeof (*vpn_list
));
+ if (
tmp
_list == NULL)
{
char errbuf[1024];
ERROR ("openvpn plugin: realloc failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
{
char errbuf[1024];
ERROR ("openvpn plugin: realloc failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
+ sfree (vpn_list);
sfree (temp->file);
sfree (temp);
return (1);
}
sfree (temp->file);
sfree (temp);
return (1);
}
+ vpn_list = tmp_list;
vpn_list[vpn_num] = temp;
vpn_num++;
vpn_list[vpn_num] = temp;
vpn_num++;