aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs6
1 files changed, 2 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index d0e0f04..17fbd02 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3910,8 +3910,7 @@ Urpm_stream2header(fp)
const char * msg = NULL;
rpmRC rc;
- pkg = (URPM__Package)malloc(sizeof(struct s_Package));
- memset(pkg, 0, sizeof(struct s_Package));
+ pkg = (URPM__Package)calloc(1, sizeof(struct s_Package));
rc = rpmpkgRead(item, fd, &pkg->h, &msg);
switch (rc) {
@@ -3953,8 +3952,7 @@ Urpm_spec2srcheader(specfile)
spec = rpmtsSetSpec(ts, NULL);
initSourceHeader(spec, NULL);
- pkg = (URPM__Package)malloc(sizeof(struct s_Package));
- memset(pkg, 0, sizeof(struct s_Package));
+ pkg = (URPM__Package)calloc(1, sizeof(struct s_Package));
he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = RPMTAG_SOURCERPM;