kdbus: Fix memory leakage in _g_kdbus_StartServiceByName() 93/199693/1
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Tue, 12 Feb 2019 14:32:44 +0000 (23:32 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 14 Feb 2019 05:43:22 +0000 (05:43 +0000)
GDBusMessage isn't freed after use.

Change-Id: I6f4b8b01dc6e8d3966ca8b8e9fde3d613635ab4d
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
(cherry picked from commit 6097bfc743d6c9d9c1005b3fe1cf029bf934dfac)

gio/gkdbus.c

index 0fdf40a..872f091 100755 (executable)
@@ -1670,10 +1670,14 @@ _g_kdbus_StartServiceByName (GKDBusWorker  *worker,
                        G_DBUS_ERROR,
                        G_DBUS_ERROR_SERVICE_UNKNOWN,
                        "The name %s was not provided by any .service files", name);
-          return G_BUS_START_SERVICE_REPLY_ERROR;
+          status = G_BUS_START_SERVICE_REPLY_ERROR;
         }
-      g_object_unref (reply);
-      status = G_BUS_START_SERVICE_REPLY_SUCCESS;
+      else
+        {
+         g_object_unref (reply);
+         status = G_BUS_START_SERVICE_REPLY_SUCCESS;
+        }
+      g_object_unref (message);
     }
   else
     status = G_BUS_START_SERVICE_REPLY_ALREADY_RUNNING;