aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgconf-comp.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-01-23 10:52:30 +0000
committerJustus Winter <[email protected]>2017-01-24 13:35:56 +0000
commit5b28f025085b386e0ec49535d4cd3f875a414eb0 (patch)
treedef299dd8356a64edc433004c68ce85e195c848c /tools/gpgconf-comp.c
parenttests: Add test demonstrating issue2929. (diff)
downloadgnupg-5b28f025085b386e0ec49535d4cd3f875a414eb0.tar.gz
gnupg-5b28f025085b386e0ec49535d4cd3f875a414eb0.zip
tools: Fix memory leak.
* 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 <[email protected]>
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r--tools/gpgconf-comp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index a25b5136e..85eb80ab5 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -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)