]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - misc/lnstat.c
Merge branch 'master' of ../iproute2-next
[mirror_iproute2.git] / misc / lnstat.c
index 659a01bd699314bc4fff3685b867106db4bb4e24..863fd4d9f03f293230fee7d0618947c2ef2478dc 100644 (file)
@@ -182,10 +182,8 @@ static struct table_hdr *build_hdr_string(struct lnstat_file *lnstat_files,
        static struct table_hdr th;
        int ofs = 0;
 
-       for (i = 0; i < HDR_LINES; i++) {
-               th.hdr[i] = malloc(HDR_LINE_LENGTH);
-               memset(th.hdr[i], 0, HDR_LINE_LENGTH);
-       }
+       for (i = 0; i < HDR_LINES; i++)
+               th.hdr[i] = calloc(1, HDR_LINE_LENGTH);
 
        for (i = 0; i < fps->num; i++) {
                char *cname, *fname = fps->params[i].lf->name;