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,15 +74,21 @@ p_gpg_init(void)
void void
p_gpg_close(void) p_gpg_close(void)
{ {
if (fingerprints) {
g_hash_table_destroy(fingerprints); g_hash_table_destroy(fingerprints);
fingerprints = NULL; fingerprints = NULL;
}
if (fpskeyfile) {
g_key_file_free(fpskeyfile); g_key_file_free(fpskeyfile);
fpskeyfile = NULL; fpskeyfile = NULL;
}
if (fpsloc) {
free(fpsloc); free(fpsloc);
fpsloc = NULL; fpsloc = NULL;
} }
}
void void
p_gpg_on_connect(const char * const barejid) p_gpg_on_connect(const char * const barejid)

View File

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

View File

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

View File

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