From cf767c71c57491e3fb159762da9ae86ebb828ef0 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Mon, 28 Apr 2008 12:50:24 +0200 Subject: [PATCH] Remove alloca() ussage from rpmcache.c --- tools/rpmcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/rpmcache.c b/tools/rpmcache.c index fd25b83..9564bfa 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); } /* -- 2.7.4