X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftable.c;h=745ec135d47e04e94ef8d9c112d97b1f20295b38;hb=3e413a72f2387d600fa00169823c7ce0d0b649b5;hp=9641c759b2b059a010492b39d6e583196b8038fd;hpb=5137825deeb5d4a5b763185f45b3916ccc49340d;p=collectd.git diff --git a/src/table.c b/src/table.c index 9641c759..745ec135 100644 --- a/src/table.c +++ b/src/table.c @@ -183,7 +183,7 @@ static int tbl_config_result (tbl_t *tbl, oconfig_item_t *ci) res = (tbl_result_t *)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))); @@ -278,8 +278,9 @@ static int tbl_config_table (oconfig_item_t *ci) if (NULL == tbl->sep) { log_err ("Table \"%s\" does not specify any separator.", tbl->file); status = 1; + } else { + strunescape (tbl->sep, strlen (tbl->sep) + 1); } - strunescape (tbl->sep, strlen (tbl->sep) + 1); if (NULL == tbl->instance) { tbl->instance = sstrdup (tbl->file);