diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-17 20:21:48 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-17 20:21:48 +0000 |
commit | c1c66c801514e3c6a1f1242994174cadbc37b5c4 (patch) | |
tree | 24dac79ee39a9a5acfaa053a3c64faa18e648ae7 | |
parent | 6320e730acc9f63354b50f0e55adca91e9e27d62 (diff) | |
download | perl-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.xs | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; |