Merge lp:~htorque/indicator-application/fix-small-memleak into lp:indicator-application/0.5

Proposed by Hernando Torque
Status: Merged
Approved by: Charles Kerr
Approved revision: 225
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~htorque/indicator-application/fix-small-memleak
Merge into: lp:indicator-application/0.5
Diff against target: 29 lines (+6/-2)
1 file modified
src/application-service-watcher.c (+6/-2)
To merge this branch: bzr merge lp:~htorque/indicator-application/fix-small-memleak
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+97110@code.launchpad.net

Description of the change

Inline use of dbus_g_method_get_sender causes a small memory leak. This patch frees the string returned by it.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Hi Hernando,

Thanks for the patch, looks good.

I've filed bug #953585 (and gave you credit there), and linked this merge request to it.

review: Approve
Revision history for this message
Hernando Torque (htorque) wrote :

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-service-watcher.c'
2--- src/application-service-watcher.c 2010-10-08 16:04:27 +0000
3+++ src/application-service-watcher.c 2012-03-12 22:00:25 +0000
4@@ -249,9 +249,11 @@
5 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
6
7 if (service[0] == '/') {
8+ char * sender = dbus_g_method_get_sender(method);
9 application_service_appstore_application_add(priv->appstore,
10- dbus_g_method_get_sender(method),
11+ sender,
12 service);
13+ g_free(sender);
14 } else {
15 application_service_appstore_application_add(priv->appstore,
16 service,
17@@ -293,9 +295,11 @@
18 {
19 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
20
21+ char * sender = dbus_g_method_get_sender(method);
22 application_service_appstore_approver_add(priv->appstore,
23- dbus_g_method_get_sender(method),
24+ sender,
25 path);
26+ g_free(sender);
27
28 dbus_g_method_return(method, G_TYPE_NONE);
29 return TRUE;

Subscribers

People subscribed via source and target branches