From bfc3d95ed6cc48ee08540f524dbbedc24d265d3f Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 18 Mar 2015 10:37:56 -0500 Subject: [PATCH 03/10] Cleanup on error, you doofus --- src/core/tools.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/tools.c b/src/core/tools.c index a98a72e..459c072 100644 --- a/src/core/tools.c +++ b/src/core/tools.c @@ -136,6 +136,7 @@ char *call_gpg_round(char *switches, char *input, char *input2, \ snip_data, round--); } +done: if(tmp2_fd) close(tmp2_fd); if(tmp2_path) free(tmp2_path); if(keyid) close(pipefd[0]); @@ -143,7 +144,8 @@ char *call_gpg_round(char *switches, char *input, char *input2, \ return output; pgp_error: - return NULL; + output = NULL; + goto done; } -- 2.1.4