diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-04-18 05:00:10 +0800 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-04-21 16:42:13 +0800 |
commit | ddae3ae13b1bf6368bd91327357e3c6999ac6a45 (patch) | |
tree | c2edd0ad897ca23aac27c4db2dbc9461422321da | |
parent | 8bf9d7759ffb6b5d64c0cbb70d928fd6349291b1 (diff) | |
download | gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar.gz gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar.bz2 gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar.lz gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar.xz gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.tar.zst gsoc2013-empathy-ddae3ae13b1bf6368bd91327357e3c6999ac6a45.zip |
Fix memleak in log_store_empathy_get_chats_for_dir. Only build filename if its
needed and freed again.
-rw-r--r-- | libempathy/empathy-log-store-empathy.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c index 11e64e0ef..37a76676f 100644 --- a/libempathy/empathy-log-store-empathy.c +++ b/libempathy/empathy-log-store-empathy.c @@ -641,17 +641,15 @@ log_store_empathy_get_chats_for_dir (EmpathyLogStore *self, while ((name = g_dir_read_name (gdir)) != NULL) { EmpathyLogSearchHit *hit; - gchar *filename; - filename = g_build_filename (dir, name, NULL); if (!is_chatroom && strcmp (name, LOG_DIR_CHATROOMS) == 0) { + gchar *filename = g_build_filename (dir, name, NULL); hits = g_list_concat (hits, log_store_empathy_get_chats_for_dir ( self, filename, TRUE)); g_free (filename); continue; } - hit = g_slice_new0 (EmpathyLogSearchHit); hit->chat_id = g_strdup (name); hit->is_chatroom = is_chatroom; |