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
=== modified file 'src/application-service-watcher.c'
--- src/application-service-watcher.c 2010-10-08 16:04:27 +0000
+++ src/application-service-watcher.c 2012-03-12 22:00:25 +0000
@@ -249,9 +249,11 @@
249 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);249 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
250250
251 if (service[0] == '/') {251 if (service[0] == '/') {
252 char * sender = dbus_g_method_get_sender(method);
252 application_service_appstore_application_add(priv->appstore,253 application_service_appstore_application_add(priv->appstore,
253 dbus_g_method_get_sender(method),254 sender,
254 service);255 service);
256 g_free(sender);
255 } else {257 } else {
256 application_service_appstore_application_add(priv->appstore,258 application_service_appstore_application_add(priv->appstore,
257 service,259 service,
@@ -293,9 +295,11 @@
293{295{
294 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);296 ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
295297
298 char * sender = dbus_g_method_get_sender(method);
296 application_service_appstore_approver_add(priv->appstore,299 application_service_appstore_approver_add(priv->appstore,
297 dbus_g_method_get_sender(method),300 sender,
298 path);301 path);
302 g_free(sender);
299303
300 dbus_g_method_return(method, G_TYPE_NONE);304 dbus_g_method_return(method, G_TYPE_NONE);
301 return TRUE;305 return TRUE;

Subscribers

People subscribed via source and target branches