Merge lp:~mitya57/gnome-system-monitor/lp1110498 into lp:~ubuntu-desktop/gnome-system-monitor/ubuntu

Proposed by Dmitry Shachnev
Status: Rejected
Rejected by: Martin Pitt
Proposed branch: lp:~mitya57/gnome-system-monitor/lp1110498
Merge into: lp:~ubuntu-desktop/gnome-system-monitor/ubuntu
Diff against target: 124 lines (+106/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/00git_leaks_fixes.patch (+98/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~mitya57/gnome-system-monitor/lp1110498
Reviewer Review Type Date Requested Status
Martin Pitt (community) Disapprove
Review via email: mp+149319@code.launchpad.net

Description of the change

This is a backport of upstream commit http://git.gnome.org/browse/gnome-system-monitor/commit/?id=c2c23596a3 that fixes some memory leaks.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

We just got 3.7.90 into raring, which already has this applied. Thanks!

review: Disapprove

Unmerged revisions

53. By Dmitry Shachnev

debian/patches/00git_leaks_fixes.patch: Fixed various memory leaks in
prettytable, procman-app, sysinfo and util (LP: #1110498).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-11-12 21:26:05 +0000
+++ debian/changelog 2013-02-19 15:52:35 +0000
@@ -1,3 +1,10 @@
1gnome-system-monitor (3.6.1-0ubuntu2) UNRELEASED; urgency=low
2
3 * debian/patches/00git_leaks_fixes.patch: Fixed various memory leaks in
4 prettytable, procman-app, sysinfo and util (LP: #1110498).
5
6 -- Dmitry Shachnev <mitya57@ubuntu.com> Tue, 19 Feb 2013 19:00:23 +0400
7
1gnome-system-monitor (3.6.1-0ubuntu1) raring; urgency=low8gnome-system-monitor (3.6.1-0ubuntu1) raring; urgency=low
29
3 * New upstream release10 * New upstream release
411
=== added file 'debian/patches/00git_leaks_fixes.patch'
--- debian/patches/00git_leaks_fixes.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/00git_leaks_fixes.patch 2013-02-19 15:52:35 +0000
@@ -0,0 +1,98 @@
1Description: Fixed various memory leaks in prettytable, procman-app, sysinfo and util.
2Origin: upstream, http://git.gnome.org/browse/gnome-system-monitor/commit/?id=c2c23596a3
3Bug: https://bugzilla.gnome.org/686812
4Bug-Ubuntu: https://bugs.launchpad.net/bugs/1110498
5
6Index: gnome-system-monitor-3.6.1/src/prettytable.cpp
7===================================================================
8--- gnome-system-monitor-3.6.1.orig/src/prettytable.cpp 2012-10-15 19:52:10.000000000 +0400
9+++ gnome-system-monitor-3.6.1/src/prettytable.cpp 2013-02-19 19:03:34.854667207 +0400
10@@ -206,6 +206,7 @@
11 icon = this->theme->load_gicon(gicon, APP_ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN);
12 }
13
14+ g_strfreev(cmdline);
15 return icon;
16 }
17
18Index: gnome-system-monitor-3.6.1/src/sysinfo.cpp
19===================================================================
20--- gnome-system-monitor-3.6.1.orig/src/sysinfo.cpp 2012-10-15 19:44:36.000000000 +0400
21+++ gnome-system-monitor-3.6.1/src/sysinfo.cpp 2013-02-19 19:03:34.854667207 +0400
22@@ -112,7 +112,10 @@
23
24 /* translators: This is the type of architecture, for example:
25 * "64-bit" or "32-bit" */
26- return string(g_strdup_printf (_("%d-bit"), bits));
27+ char* bytes = g_strdup_printf (_("%d-bit"), bits);
28+ string retval(bytes);
29+ g_free(bytes);
30+ return retval;
31 }
32
33 typedef struct
34Index: gnome-system-monitor-3.6.1/src/util.cpp
35===================================================================
36--- gnome-system-monitor-3.6.1.orig/src/util.cpp 2012-10-15 19:44:36.000000000 +0400
37+++ gnome-system-monitor-3.6.1/src/util.cpp 2013-02-19 19:24:38.615519347 +0400
38@@ -590,7 +590,10 @@
39
40 std::string format_network(guint64 rate, guint64 max_rate)
41 {
42- return procman::format_size(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
43+ char* bytes = procman::format_size(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
44+ std::string formatted(bytes);
45+ g_free(bytes);
46+ return formatted;
47 }
48
49
50Index: gnome-system-monitor-3.6.1/src/procman.cpp
51===================================================================
52--- gnome-system-monitor-3.6.1.orig/src/procman.cpp 2012-10-15 19:44:36.000000000 +0400
53+++ gnome-system-monitor-3.6.1/src/procman.cpp 2013-02-19 19:23:03.381350019 +0400
54@@ -193,6 +193,7 @@
55 child = g_variant_get_child_value ( cpu_colors_var, i );
56 g_variant_get_child( child, 1, "s", &color);
57 g_variant_builder_add_value ( &builder, child);
58+ g_variant_unref (child);
59 } else {
60 color = g_strdup ("#f25915e815e8");
61 g_variant_builder_add(&builder, "(us)", i, color);
62@@ -204,7 +205,11 @@
63 // if the user has more cores than colors stored in the gsettings, store the newly built gvariant in gsettings
64 if (n < static_cast<guint>(procdata->config.num_cpus)) {
65 g_settings_set_value(settings, "cpu-colors", full);
66+ } else {
67+ g_variant_unref(full);
68 }
69+
70+ g_variant_unref(cpu_colors_var);
71 }
72
73 static void
74@@ -223,7 +228,7 @@
75 return;
76 }
77
78- const gchar *color = g_settings_get_string (settings, key);
79+ gchar *color = g_settings_get_string (settings, key);
80 if (g_str_equal (key, "mem-color")) {
81 gdk_color_parse (color, &procdata->config.mem_color);
82 procdata->mem_graph->colors.at(0) = procdata->config.mem_color;
83@@ -243,6 +248,7 @@
84 else {
85 g_assert_not_reached();
86 }
87+ g_free (color);
88 }
89
90 static void
91@@ -457,6 +463,7 @@
92
93 proctable_set_columns_order(GTK_TREE_VIEW(tree), order);
94
95+ g_variant_unref(value);
96 g_slist_free(order);
97 }
98
099
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-08-24 13:36:34 +0000
+++ debian/patches/series 2013-02-19 15:52:35 +0000
@@ -1,1 +1,2 @@
1# Debian patches for gnome-system-monitor1# Debian patches for gnome-system-monitor
200git_leaks_fixes.patch

Subscribers

People subscribed via source and target branches