summaryrefslogtreecommitdiff
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2014-06-23 09:05:47 +0200
committerJunio C Hamano <gitster@pobox.com>2014-06-23 15:50:29 -0700
commit01e57b5d91b0c9f2ac93708c5c2cbcd4731ddd34 (patch)
tree6cac8943a32b4a22c3c4e78d41a538f77b78a590 /gpg-interface.c
parent0953113bb5687f42bcdfc3d20dd3a125784ad383 (diff)
downloadgit-01e57b5d91b0c9f2ac93708c5c2cbcd4731ddd34.tar.gz
gpg-interface: provide clear helper for struct signature_check
The struct has been growing members whose malloced memory needs to be freed. Do this with one helper function so that no malloced memory shall be left unfreed. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index 8b0e87436b..e71b59daf6 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -7,6 +7,18 @@
static char *configured_signing_key;
static const char *gpg_program = "gpg";
+void signature_check_clear(struct signature_check *sigc)
+{
+ free(sigc->gpg_output);
+ free(sigc->gpg_status);
+ free(sigc->signer);
+ free(sigc->key);
+ sigc->gpg_output = NULL;
+ sigc->gpg_status = NULL;
+ sigc->signer = NULL;
+ sigc->key = NULL;
+}
+
void set_signing_key(const char *key)
{
free(configured_signing_key);