]> git.pond.sub.org Git - empserver/commitdiff
(xundump): Use malloc() instead of calloc() for fldca and fldidx,
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Aug 2007 18:52:16 +0000 (18:52 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Aug 2007 18:52:16 +0000 (18:52 +0000)
because the used part of these arrays is explicitely initialized by
deffld().

src/lib/common/xundump.c

index e839e2071660b47ae7dd33ae62a537b5e4afc6dc..7200e354da02f6b1bf5e5bbbe3e2a7bb2a8c3d86 100644 (file)
@@ -771,8 +771,8 @@ xundump(FILE *fp, char *file, int *plno, int expected_table)
        if (!(ca[i].ca_flags & NSC_EXTRA))
            nf += MAX(1, ca[i].ca_type != NSC_STRINGY ? ca[i].ca_len : 0);
     }
-    fldca = calloc(nf, sizeof(*fldca));
-    fldidx = calloc(nf, sizeof(*fldidx));
+    fldca = malloc(nf * sizeof(*fldca));
+    fldidx = malloc(nf * sizeof(*fldidx));
     caflds = malloc(nca * sizeof(*caflds));
     cafldspp = calloc(nca, sizeof(*cafldspp));
     cur_type = type;