summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4e3ffe)
raw | patch | inline | side by side (parent: b4e3ffe)
author | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 14:38:59 +0000 (15:38 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 14:38:59 +0000 (15:38 +0100) |
src/ovs_stats.c | patch | blob | history |
diff --git a/src/ovs_stats.c b/src/ovs_stats.c
index 8309223b0243bec4874c486233f5394708965dab..e7859da20eff651384316f28b80abac7dfd9fb53 100644 (file)
--- a/src/ovs_stats.c
+++ b/src/ovs_stats.c
br = ovs_stats_get_bridge(g_bridge_list_head, YAJL_GET_STRING(br_name));
pthread_mutex_lock(&g_stats_lock);
if (br == NULL) {
- br = (bridge_list_t *)calloc(1, sizeof(bridge_list_t));
+ br = calloc(1, sizeof(*br));
if (!br) {
pthread_mutex_unlock(&g_stats_lock);
- ERROR("%s: Error allocating memory for bridge", plugin_name);
+ ERROR("%s: calloc(%zu) failed.", plugin_name, sizeof(*br));
return -1;
}
char *tmp = YAJL_GET_STRING(br_name);
if (br->name == NULL) {
sfree(br);
pthread_mutex_unlock(&g_stats_lock);
+ ERROR("%s: strdup failed.", plugin_name);
return -1;
}
br->next = g_bridge_list_head;