summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-18 13:13:06 (GMT)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-18 14:07:40 (GMT)
commit20cd431e94e662e099f6437feb5cf1a1e92959a6 (patch)
treea4fc38be045ffb189d1ed99eeddb1b808851cd92
parent8cdd3cf4711ea6655f65676c93b252ae641d4581 (diff)
downloadtelepathy-logger-20cd431e94e662e099f6437feb5cf1a1e92959a6.tar.gz
logger: fix several string and date leaks
Reviewed-by: Guillaume Desmottes (cherry picked from commit a4103cf87192a7e57d1b762438f53cef3c3e61fa)
-rw-r--r--telepathy-logger/log-store-pidgin.c4
-rw-r--r--telepathy-logger/log-store-xml.c11
2 files changed, 13 insertions, 2 deletions
diff --git a/telepathy-logger/log-store-pidgin.c b/telepathy-logger/log-store-pidgin.c
index 2f26873..78100f4 100644
--- a/telepathy-logger/log-store-pidgin.c
+++ b/telepathy-logger/log-store-pidgin.c
@@ -689,6 +689,7 @@ log_store_pidgin_get_events_for_files (TplLogStore *self,
if (hits == NULL)
{
g_strfreev (lines);
+ g_free (date_str);
continue;
}
@@ -696,6 +697,7 @@ log_store_pidgin_get_events_for_files (TplLogStore *self,
{
g_strfreev (lines);
g_strfreev (hits);
+ g_free (date_str);
continue;
}
@@ -837,6 +839,7 @@ log_store_pidgin_get_events_for_files (TplLogStore *self,
g_free (sender_name);
g_free (time_str);
g_object_unref (sender);
+ g_free (body);
i = j - 1;
}
@@ -846,6 +849,7 @@ log_store_pidgin_get_events_for_files (TplLogStore *self,
g_free (own_user);
g_free (date);
g_free (protocol);
+ g_free (date_str);
g_strfreev (lines);
}
diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c
index c050224..7ba27ed 100644
--- a/telepathy-logger/log-store-xml.c
+++ b/telepathy-logger/log-store-xml.c
@@ -520,6 +520,7 @@ add_text_event (TplLogStoreXml *self,
guint edit_timestamp;
g_string_append_printf (event, " supersedes-token='%s'",
supersedes_token);
+ g_free (supersedes_token);
edit_timestamp = tpl_text_event_get_edit_timestamp (message);
if (edit_timestamp != 0)
@@ -1482,6 +1483,10 @@ log_store_xml_get_all_files (TplLogStoreXml *self,
log_store_xml_get_all_files (self, filename, type_mask));
g_free (filename);
}
+ else
+ {
+ g_free (filename);
+ }
}
out:
@@ -1493,7 +1498,9 @@ out:
return files;
}
-
+/*
+ * @files: (transfer full) (element-type utf8):
+ */
static GList *
_log_store_xml_search_in_files (TplLogStoreXml *self,
const gchar *text,
@@ -1576,7 +1583,7 @@ out:
if (regex != NULL)
g_regex_unref (regex);
- g_list_free (files);
+ g_list_free_full (files, g_free);
return hits;
}