@cryptotaxi247 / netdata-1 / commits / 9ae48c333

Use reallocz()

Chocobo1 committed Sep 25, 2016 at 17:41 UTC 9ae48c3336d979f7e2beb6f1ce0e154ff9b93334
1 file changed +1 -5
src/plugin_nfacct.c
+1 -5
@@ -27,11 +27,7 @@ static int nfacct_callback(const struct nlmsghdr *nlh, void *data) {
27
28 info("nfacct.plugin: increasing nfacct_list to size %d", size);
29
30 - nfacct_list = realloc(nfacct_list, sizeof(struct nfacct_list) + (sizeof(struct mynfacct) * size));
31 - if(!nfacct_list) {
32 - error("nfacct.plugin: cannot allocate nfacct_list.");
33 - return MNL_CB_OK;
34 - }
30 + nfacct_list = reallocz(nfacct_list, sizeof(struct nfacct_list) + (sizeof(struct mynfacct) * size));
31
32 nfacct_list->data[len].nfacct = nfacct_alloc();
33 if(!nfacct_list->data[size - 1].nfacct) {