summaryrefslogtreecommitdiff
path: root/lib/rpminstall.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-25 13:54:59 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-25 15:29:12 +0300
commitb046a85409cecc5d7efdb75185fe155e0e3e4293 (patch)
tree7845050ee8690fa1d6619f8d386178487e96db52 /lib/rpminstall.c
parent12ad8a5194168cf5213dc359283a8997c5501999 (diff)
downloadlibrpm-tizen-b046a85409cecc5d7efdb75185fe155e0e3e4293.tar.gz
librpm-tizen-b046a85409cecc5d7efdb75185fe155e0e3e4293.tar.bz2
librpm-tizen-b046a85409cecc5d7efdb75185fe155e0e3e4293.zip
Avoid alloca() in rpmInstall()
Diffstat (limited to 'lib/rpminstall.c')
-rw-r--r--lib/rpminstall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 2b1196afe..652dcd2cb 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -210,7 +210,7 @@ struct rpmEIU {
/** @todo Generalize --freshen policies. */
int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
{
- struct rpmEIU * eiu = memset(alloca(sizeof(*eiu)), 0, sizeof(*eiu));
+ struct rpmEIU * eiu = xcalloc(1, sizeof(*eiu));
rpmps ps;
rpmprobFilterFlags probFilter;
rpmRelocation * relocations;
@@ -605,6 +605,7 @@ exit:
eiu->pkgState = _free(eiu->pkgState);
eiu->pkgURL = _free(eiu->pkgURL);
eiu->argv = _free(eiu->argv);
+ free(eiu);
rpmtsEmpty(ts);