summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1581f3b)
raw | patch | inline | side by side (parent: 1581f3b)
author | Florian Forster <octo@collectd.org> | |
Fri, 6 Oct 2017 12:45:05 +0000 (14:45 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 6 Oct 2017 12:45:05 +0000 (14:45 +0200) |
Shoutout to scan-build for finding this one!
src/libcollectdclient/network_parse.c | patch | blob | history |
index 4083e1ec8ff5017da20b5afcfd8bbed363535d48..67034116b9f90a6b0e7f869c71713efdf2978de2 100644 (file)
state->values = calloc(sizeof(*state->values), state->values_len);
state->values_types = calloc(sizeof(*state->values_types), state->values_len);
if ((state->values == NULL) || (state->values_types == NULL)) {
- free(state->values);
- free(state->values_types);
return ENOMEM;
}
case TYPE_VALUES: {
lcc_value_list_t vl = state;
if (parse_values(payload, sizeof(payload), &vl)) {
+ free(vl.values);
+ free(vl.values_types);
DEBUG("lcc_network_parse(): parse_values failed.\n");
return EINVAL;
}