tools: Fix memory leak.
authorJustus Winter <justus@g10code.com>
Mon, 23 Jan 2017 10:52:30 +0000 (11:52 +0100)
committerJustus Winter <justus@g10code.com>
Tue, 24 Jan 2017 13:35:56 +0000 (14:35 +0100)
* tools/gpgconf-comp.c (change_options_file): Fix leak.
--
Previously, 'src_filename' and 'orig_filename' leaked if creating the
backup file failed.

Signed-off-by: Justus Winter <justus@g10code.com>
tools/gpgconf-comp.c

index a25b513..85eb80a 100644 (file)
@@ -2641,6 +2641,8 @@ change_options_file (gc_component_t component, gc_backend_t backend,
   if (res < 0 && errno != ENOENT)
     {
       xfree (dest_filename);
+      xfree (src_filename);
+      xfree (orig_filename);
       return -1;
     }
   if (res < 0)