[jscorebus] Fix memory leak in sync calls, the reply message was not freed
authorKalle Vahlman <kalle.vahlman@movial.com>
Wed, 15 Apr 2009 09:12:57 +0000 (12:12 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Wed, 15 Apr 2009 09:12:57 +0000 (12:12 +0300)
jscorebus/jscorebus-method.c

index 4ccc38ff7e5067419abf2a03e5f4c1d0ece37877..581d1dc8aac6f076f6382420e953ef817a3fc11b 100644 (file)
@@ -278,6 +278,7 @@ JSValueRef call_sync(JSContextRef context, MethodPrivate *priv)
       } else {
         g_warning("Unknown reply!");
       }
+      dbus_message_unref(reply_message);
     } else {
       // TODO: set exception
       g_warning("Failed to send message to %s", priv->destination);
@@ -327,7 +328,10 @@ void pending_call_notify(DBusPendingCall *pending,
   } else {
     g_warning("Unknown reply!");
   }
-
+  if (reply_message != NULL)
+  {
+    dbus_message_unref(reply_message);
+  }
 }
 
 static