1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Fix memory leaks

This commit is contained in:
James Booth 2016-07-25 22:23:54 +01:00
parent 943e91268c
commit d5d04756ce
2 changed files with 3 additions and 1 deletions

View File

@ -403,7 +403,7 @@ _chat_log_chat(const char *const login, const char *const other, const char *con
void void
groupchat_log_chat(const gchar *const login, const gchar *const room, const gchar *const nick, const gchar *const msg) groupchat_log_chat(const gchar *const login, const gchar *const room, const gchar *const nick, const gchar *const msg)
{ {
gchar *room_copy = strdup(room); char *room_copy = strdup(room);
struct dated_chat_log *dated_log = g_hash_table_lookup(groupchat_logs, room_copy); struct dated_chat_log *dated_log = g_hash_table_lookup(groupchat_logs, room_copy);
// no log for room // no log for room
@ -416,6 +416,7 @@ groupchat_log_chat(const gchar *const login, const gchar *const room, const gcha
dated_log = _create_groupchat_log(room_copy, login); dated_log = _create_groupchat_log(room_copy, login);
g_hash_table_replace(logs, room_copy, dated_log); g_hash_table_replace(logs, room_copy, dated_log);
} }
free(room_copy);
GDateTime *dt = g_date_time_new_now_local(); GDateTime *dt = g_date_time_new_now_local();

View File

@ -299,6 +299,7 @@ plugins_run_command(const char * const input)
curr_hash = g_list_next(curr_hash); curr_hash = g_list_next(curr_hash);
} }
g_list_free(command_hashes);
g_strfreev(split); g_strfreev(split);
return FALSE; return FALSE;
} }