]> arthur.barton.de Git - netdata.git/commitdiff
Use reallocz()
authorChocobo1 <Chocobo1@users.noreply.github.com>
Sun, 25 Sep 2016 09:41:10 +0000 (17:41 +0800)
committerChocobo1 <Chocobo1@users.noreply.github.com>
Mon, 26 Sep 2016 03:40:11 +0000 (11:40 +0800)
src/plugin_nfacct.c

index b114cbb91a5c23349be420bdfec67c90cc521467..e513e5d0e7a09ab37b262159d7220de428d21ba5 100644 (file)
@@ -27,11 +27,7 @@ static int nfacct_callback(const struct nlmsghdr *nlh, void *data) {
 
         info("nfacct.plugin: increasing nfacct_list to size %d", size);
 
-        nfacct_list = realloc(nfacct_list, sizeof(struct nfacct_list) + (sizeof(struct mynfacct) * size));
-        if(!nfacct_list) {
-            error("nfacct.plugin: cannot allocate nfacct_list.");
-            return MNL_CB_OK;
-        }
+        nfacct_list = reallocz(nfacct_list, sizeof(struct nfacct_list) + (sizeof(struct mynfacct) * size));
 
         nfacct_list->data[len].nfacct = nfacct_alloc();
         if(!nfacct_list->data[size - 1].nfacct) {