[sysprof/wip/gtk4: 2/2] SpLocalProfiler: Fix some memory leaks
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/gtk4: 2/2] SpLocalProfiler: Fix some memory leaks
- Date: Wed, 16 Aug 2017 10:11:21 +0000 (UTC)
commit 37bf6023ac7b2f457fd4d2d3a50363f18b2509f5
Author: Timm Bäder <mail baedert org>
Date: Wed Aug 16 12:01:43 2017 +0200
SpLocalProfiler: Fix some memory leaks
lib/sp-kernel-symbol.c | 5 ++++-
lib/sp-local-profiler.c | 5 +++++
lib/util/binfile.c | 2 ++
3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/lib/sp-kernel-symbol.c b/lib/sp-kernel-symbol.c
index 3a3d9c9..be2e0df 100644
--- a/lib/sp-kernel-symbol.c
+++ b/lib/sp-kernel-symbol.c
@@ -109,7 +109,10 @@ sp_kernel_symbol_load (void)
gchar *endptr;
if (g_hash_table_contains (skip, tokens [2]))
- continue;
+ {
+ g_strfreev (tokens);
+ continue;
+ }
address = g_ascii_strtoull (tokens [0], &endptr, 16);
diff --git a/lib/sp-local-profiler.c b/lib/sp-local-profiler.c
index aa00f3a..835b937 100644
--- a/lib/sp-local-profiler.c
+++ b/lib/sp-local-profiler.c
@@ -252,8 +252,13 @@ sp_local_profiler_finalize (GObject *object)
g_clear_pointer (&priv->starting, g_ptr_array_unref);
g_clear_pointer (&priv->stopping, g_ptr_array_unref);
g_clear_pointer (&priv->finished_or_failed, g_ptr_array_unref);
+ g_clear_pointer (&priv->failures, g_ptr_array_unref);
g_clear_pointer (&priv->pids, g_array_unref);
+ g_strfreev (priv->spawn_env);
+ g_strfreev (priv->spawn_argv);
+
+
G_OBJECT_CLASS (sp_local_profiler_parent_class)->finalize (object);
}
diff --git a/lib/util/binfile.c b/lib/util/binfile.c
index 1b02978..6a4136b 100644
--- a/lib/util/binfile.c
+++ b/lib/util/binfile.c
@@ -338,6 +338,8 @@ get_vdso_bytes (size_t *length)
has_data = TRUE;
}
}
+
+ g_strfreev (lines);
}
if (length)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]