summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-25 15:37:09 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-25 15:37:09 +0300
commit8e4a5f88cecb6c9f577cff91317851bc94abd8e9 (patch)
tree0cd1701401bcb25f86b05223f050b41f09b4105c /lib
parent8660bd61f6bbfa20635ef74827b36864d9ec0e7b (diff)
downloadrpm-8e4a5f88cecb6c9f577cff91317851bc94abd8e9.tar.gz
rpm-8e4a5f88cecb6c9f577cff91317851bc94abd8e9.tar.bz2
rpm-8e4a5f88cecb6c9f577cff91317851bc94abd8e9.zip
Avoid alloca() in markReplacedFiles()
Diffstat (limited to 'lib')
-rw-r--r--lib/psm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 193ad4eb0..fffd7bbd1 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -185,7 +185,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm)
if (num == 0)
return RPMRC_OK;
- offsets = alloca(num * sizeof(*offsets));
+ offsets = xmalloc(num * sizeof(*offsets));
offsets[0] = 0;
num = prev = 0;
for (sfi = replaced; sfi->otherPkg; sfi++) {
@@ -227,6 +227,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm)
}
}
mi = rpmdbFreeIterator(mi);
+ free(offsets);
return RPMRC_OK;
}