summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-04-28 12:50:24 +0200
committerJindrich Novy <jnovy@redhat.com>2008-04-28 12:50:24 +0200
commitcf767c71c57491e3fb159762da9ae86ebb828ef0 (patch)
treea3dd218da06865775a4c9c3a100d1b58d4375d4b
parent39dcd57e7fbcc56baed1ac40f518f510b3ca7c32 (diff)
downloadrpm-cf767c71c57491e3fb159762da9ae86ebb828ef0.tar.gz
rpm-cf767c71c57491e3fb159762da9ae86ebb828ef0.tar.bz2
rpm-cf767c71c57491e3fb159762da9ae86ebb828ef0.zip
Remove alloca() ussage from rpmcache.c
-rw-r--r--tools/rpmcache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/rpmcache.c b/tools/rpmcache.c
index fd25b83a9..9564bfaa3 100644
--- a/tools/rpmcache.c
+++ b/tools/rpmcache.c
@@ -222,7 +222,7 @@ static int ftsStashLatest(FTSENT * fts, rpmts ts)
add = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL|RPMSENSE_LESS));
if (items != NULL && nitems > 0) {
- Item needle = memset(alloca(sizeof(*needle)), 0, sizeof(*needle));
+ Item needle = xcalloc(1, sizeof(*needle));
Item * found, * fneedle = &needle;
needle->this = add;
@@ -244,6 +244,7 @@ static int ftsStashLatest(FTSENT * fts, rpmts ts)
i = found - items;
break;
}
+ free(needle);
}
/*