Remove alloca() ussage from rpmcache.c
authorJindrich Novy <jnovy@redhat.com>
Mon, 28 Apr 2008 10:50:24 +0000 (12:50 +0200)
committerJindrich Novy <jnovy@redhat.com>
Mon, 28 Apr 2008 10:50:24 +0000 (12:50 +0200)
tools/rpmcache.c

index fd25b83..9564bfa 100644 (file)
@@ -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);
     }
 
     /*