Remove unnecessary xstrdup() of dynamically allocated buffer
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 18 Apr 2008 12:39:07 +0000 (15:39 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 18 Apr 2008 12:39:07 +0000 (15:39 +0300)
- leftover from when target buffer was static...

rpmio/macro.c

index c8af070..23ecd69 100644 (file)
@@ -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;
 }