aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-06 19:43:57 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-06 19:43:57 +0000
commit088d8dc75626570e71924c7cf6c32cb0bd948d59 (patch)
tree755197fee6251a8976d72b98e45c4a6f0434933d
parent8d070db39eaa2b957b92e9a0fc0653b2277d7148 (diff)
downloadperl-URPM-088d8dc75626570e71924c7cf6c32cb0bd948d59.tar
perl-URPM-088d8dc75626570e71924c7cf6c32cb0bd948d59.tar.gz
perl-URPM-088d8dc75626570e71924c7cf6c32cb0bd948d59.tar.bz2
perl-URPM-088d8dc75626570e71924c7cf6c32cb0bd948d59.tar.xz
perl-URPM-088d8dc75626570e71924c7cf6c32cb0bd948d59.zip
(Urpm_stream2header) use calloc() instead of malloc()+memset()
-rw-r--r--URPM.xs3
1 files changed, 1 insertions, 2 deletions
diff --git a/URPM.xs b/URPM.xs
index cd9afad..ad6f155 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3814,8 +3814,7 @@ Urpm_stream2header(fp)
URPM__Package pkg;
PPCODE:
if ((fd = fdDup(fileno(fp)))) {
- pkg = (URPM__Package)malloc(sizeof(struct s_Package));
- memset(pkg, 0, sizeof(struct s_Package));
+ pkg = (URPM__Package)calloc(1, sizeof(struct s_Package));
pkg->h = headerRead(fd, HEADER_MAGIC_YES);
if (pkg->h) {
SV *sv_pkg;