tools: Free variable before return
authorJoshua Rogers <git@internot.info>
Mon, 22 Dec 2014 13:47:50 +0000 (00:47 +1100)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 13 Jan 2015 01:52:23 +0000 (10:52 +0900)
* 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 c43e87a..83bc24e 100644 (file)
@@ -2390,7 +2390,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);