From ad9d933514a6ab5015bccf7a7022f0d2319deab7 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 29 Apr 2008 10:40:56 +0300 Subject: [PATCH] Avoid alloca() in legacyRetrofit() --- lib/legacy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/legacy.c b/lib/legacy.c index 3e6d4d1..ae6d7e0 100644 --- a/lib/legacy.c +++ b/lib/legacy.c @@ -234,9 +234,10 @@ void legacyRetrofit(Header h) */ if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (rpm_data_t *) &prefix, NULL)) { - const char * nprefix = stripTrailingChar(alloca_strdup(prefix), '/'); + char * nprefix = stripTrailingChar(xstrdup(prefix), '/'); (void) headerAddEntry(h, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE, &nprefix, 1); + free(nprefix); } /* -- 2.7.4