X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=d05dd72309f80ffd79c6e94fbe2c9509d962afce;hb=354f9991530248e45207d236eb74c1cc3d5238ef;hp=caaad47a4acc8e03902e93277b67dfe52c0f1df2;hpb=28fa063b625c772f45c99b618f498715fb98474b;p=collectd.git diff --git a/src/interface.c b/src/interface.c index caaad47a..d05dd723 100644 --- a/src/interface.c +++ b/src/interface.c @@ -190,7 +190,7 @@ static int interface_read (void) struct ifaddrs *if_list; struct ifaddrs *if_ptr; -/* Darin/Mac OS X and possible other *BSDs */ +/* Darwin/Mac OS X and possible other *BSDs */ #if HAVE_STRUCT_IF_DATA # define IFA_DATA if_data # define IFA_RX_BYTES ifi_ibytes @@ -368,9 +368,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;