X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftable.c;h=38d5f03a0161fc6e905da089fb6ce9002ee5f739;hb=45f80d3776633246f80b124d958b4e6a2e36b392;hp=4e34a9ec718ed9e90683981c93eb8a5bbc2c1588;hpb=042c592bcddeea04cf81230ba9c97a09c5d3595c;p=collectd.git diff --git a/src/table.c b/src/table.c index 4e34a9ec..38d5f03a 100644 --- a/src/table.c +++ b/src/table.c @@ -188,9 +188,9 @@ static int tbl_config_result (tbl_t *tbl, oconfig_item_t *ci) return 1; } - res = (tbl_result_t *)realloc (tbl->results, + res = realloc (tbl->results, (tbl->results_num + 1) * sizeof (*tbl->results)); - if (NULL == tbl) { + if (res == NULL) { char errbuf[1024]; log_err ("realloc failed: %s.", sstrerror (errno, errbuf, sizeof (errbuf))); @@ -254,7 +254,7 @@ static int tbl_config_table (oconfig_item_t *ci) return 1; } - tbl = (tbl_t *)realloc (tables, (tables_num + 1) * sizeof (*tables)); + tbl = realloc (tables, (tables_num + 1) * sizeof (*tables)); if (NULL == tbl) { char errbuf[1024]; log_err ("realloc failed: %s.",