Free prefs strings, check for NULLs when closing pgp module

This commit is contained in:
James Booth
2015-06-24 14:27:40 +01:00
parent 815ca16f48
commit 17919298f7
4 changed files with 17 additions and 6 deletions

View File

@@ -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