X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Finterface.c;h=bc2121bd48cccc401118c5789bd918a4ba038437;hb=21ab7512825cf8177d5eee5101344b45d0854610;hp=90dc139dccc0131ff7b83a8921b8333beb615c84;hpb=124f321bbbf0d27fe2b3e5bcb53773fc1686e133;p=collectd.git diff --git a/src/interface.c b/src/interface.c index 90dc139d..bc2121bd 100644 --- a/src/interface.c +++ b/src/interface.c @@ -135,7 +135,6 @@ static int interface_config (const char *key, const char *value) static int interface_init (void) { kstat_t *ksp_chain; - derive_t val; numif = 0; @@ -152,7 +151,7 @@ static int interface_init (void) continue; if (kstat_read (kc, ksp_chain, NULL) == -1) continue; - if ((val = get_kstat_value (ksp_chain, "obytes")) == -1LL) + if (get_kstat_value (ksp_chain, "obytes") == -1LL) continue; ksp[numif++] = ksp_chain; } @@ -368,9 +367,8 @@ static int interface_read (void) if (pnif != nif || ifstat == NULL) { - if (ifstat != NULL) - free(ifstat); - ifstat = malloc(nif * sizeof(perfstat_netinterface_t)); + free(ifstat); + ifstat = malloc(nif * sizeof (*ifstat)); } pnif = nif;