| 1 |
From bfc3d95ed6cc48ee08540f524dbbedc24d265d3f Mon Sep 17 00:00:00 2001 |
| 2 |
From: Stephen Paul Weber <[email protected]> |
| 3 |
Date: Wed, 18 Mar 2015 10:37:56 -0500 |
| 4 |
Subject: [PATCH 03/10] Cleanup on error, you doofus |
| 5 |
|
| 6 |
--- |
| 7 |
src/core/tools.c | 4 +++- |
| 8 |
1 file changed, 3 insertions(+), 1 deletion(-) |
| 9 |
|
| 10 |
diff --git a/src/core/tools.c b/src/core/tools.c |
| 11 |
index a98a72e..459c072 100644 |
| 12 |
--- a/src/core/tools.c |
| 13 |
+++ b/src/core/tools.c |
| 14 |
@@ -136,6 +136,7 @@ char *call_gpg_round(char *switches, char *input, char *input2, \ |
| 15 |
snip_data, round--); |
| 16 |
} |
| 17 |
|
| 18 |
+done: |
| 19 |
if(tmp2_fd) close(tmp2_fd); |
| 20 |
if(tmp2_path) free(tmp2_path); |
| 21 |
if(keyid) close(pipefd[0]); |
| 22 |
@@ -143,7 +144,8 @@ char *call_gpg_round(char *switches, char *input, char *input2, \ |
| 23 |
|
| 24 |
return output; |
| 25 |
pgp_error: |
| 26 |
- return NULL; |
| 27 |
+ output = NULL; |
| 28 |
+ goto done; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
-- |
| 33 |
2.1.4 |
| 34 |
|