tools: Free variable before return
authorJoshua Rogers <git@internot.info>
Mon, 22 Dec 2014 13:47:50 +0000 (00:47 +1100)
committerWerner Koch <wk@gnupg.org>
Mon, 22 Dec 2014 15:20:55 +0000 (16:20 +0100)
* tools/gpgconf-comp.c: Free 'dest_filename' before it is returned
upon error.
--

Signed-off-by: Joshua Rogers <git@internot.info>
tools/gpgconf-comp.c

index 8c47b2e..61faa1d 100644 (file)
@@ -2508,7 +2508,10 @@ change_options_file (gc_component_t component, gc_backend_t backend,
   res = link (dest_filename, orig_filename);
 #endif
   if (res < 0 && errno != ENOENT)
-    return -1;
+    {
+      xfree (dest_filename);
+      return -1;
+    }
   if (res < 0)
     {
       xfree (orig_filename);