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

Subscribers

People subscribed via source and target branches