1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

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

View File

@ -1043,6 +1043,7 @@ cons_roster_setting(void)
char *by = prefs_get_string(PREF_ROSTER_BY);
cons_show("Roster by (/roster) : %s", by);
prefs_free_string(by);
int size = prefs_get_roster_size();
cons_show("Roster size (/roster) : %d", size);

View File

@ -449,6 +449,7 @@ _inp_rl_tab_handler(int count, int key)
if (result) {
rl_replace_line(result, 0);
rl_point = rl_end;
free(result);
}
}

View File

@ -136,6 +136,7 @@ status_bar_resize(void)
} else {
mvwprintw(status_bar, 0, 1, message);
}
prefs_free_string(time_pref);
}
if (last_time) {
g_date_time_unref(last_time);
@ -310,6 +311,7 @@ status_bar_print_message(const char * const msg)
} else {
mvwprintw(status_bar, 0, 1, message);
}
prefs_free_string(time_pref);
int cols = getmaxx(stdscr);
int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
@ -459,6 +461,7 @@ _status_bar_draw(void)
wattroff(status_bar, bracket_attrs);
g_free(date_fmt);
}
prefs_free_string(time_pref);
_update_win_statuses();
wnoutrefresh(status_bar);