diff options
author | James Booth <boothj5@gmail.com> | 2015-06-24 14:27:40 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-06-24 14:27:40 +0100 |
commit | 17919298f78531dbec1eb1b22db1dfc8ad76d854 (patch) | |
tree | 93bdb9d28542a0944e0662c3003602b041784d3e /src/pgp/gpg.c | |
parent | 815ca16f48b38fea0f8e06fb0164e4ba1894a932 (diff) | |
download | profani-tty-17919298f78531dbec1eb1b22db1dfc8ad76d854.tar.gz |
Free prefs strings, check for NULLs when closing pgp module
Diffstat (limited to 'src/pgp/gpg.c')
-rw-r--r-- | src/pgp/gpg.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index e02a3595..32259f61 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -74,14 +74,20 @@ p_gpg_init(void) void p_gpg_close(void) { - g_hash_table_destroy(fingerprints); - fingerprints = NULL; + if (fingerprints) { + g_hash_table_destroy(fingerprints); + fingerprints = NULL; + } - g_key_file_free(fpskeyfile); - fpskeyfile = NULL; + if (fpskeyfile) { + g_key_file_free(fpskeyfile); + fpskeyfile = NULL; + } - free(fpsloc); - fpsloc = NULL; + if (fpsloc) { + free(fpsloc); + fpsloc = NULL; + } } void |