From 38a975b157b504f1234b37c17bc072dd1eb291f6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 18 Apr 2008 15:39:07 +0300 Subject: [PATCH] Remove unnecessary xstrdup() of dynamically allocated buffer - leftover from when target buffer was static... --- rpmio/macro.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index c8af070..23ecd69 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1593,7 +1593,7 @@ rpmExpand(const char *arg, ...) va_list ap; if (arg == NULL) { - res = xstrdup(""); + buf = xstrdup(""); goto exit; } @@ -1607,10 +1607,9 @@ rpmExpand(const char *arg, ...) pe = stpcpy(pe, s); va_end(ap); (void) expandMacros(NULL, NULL, buf, blen); - res = xstrdup(buf); exit: - _free(buf); + res = buf; return res; } -- 2.7.4