aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-17 20:21:48 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-12-17 20:21:48 +0000
commitc1c66c801514e3c6a1f1242994174cadbc37b5c4 (patch)
tree24dac79ee39a9a5acfaa053a3c64faa18e648ae7
parent6320e730acc9f63354b50f0e55adca91e9e27d62 (diff)
downloadperl-URPM-c1c66c801514e3c6a1f1242994174cadbc37b5c4.tar
perl-URPM-c1c66c801514e3c6a1f1242994174cadbc37b5c4.tar.gz
perl-URPM-c1c66c801514e3c6a1f1242994174cadbc37b5c4.tar.bz2
perl-URPM-c1c66c801514e3c6a1f1242994174cadbc37b5c4.tar.xz
perl-URPM-c1c66c801514e3c6a1f1242994174cadbc37b5c4.zip
in stead of malloc() & memset() afterwards to zero out memory, just use calloc() right away in stead
-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;