Plug a minor memory leak in librpmbuild doPatch()
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 17 Nov 2010 13:54:38 +0000 (15:54 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 17 Nov 2010 13:54:38 +0000 (15:54 +0200)
build/parsePrep.c

index af31acd..ac671cc 100644 (file)
@@ -103,7 +103,6 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db,
 
     patchcmd = rpmExpand("%{uncompress: ", fn, "} | %{__patch} ", args, NULL);
 
-    free(arg_patch_flags);
     free(arg_fuzz);
     free(arg_dir);
     free(arg_backup);
@@ -121,6 +120,7 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db,
     free(patchcmd);
 
 exit:
+    free(arg_patch_flags);
     free(fn);
     return buf;
 }