From 11184a56604d644678405a044f68bdfb5c41dbcf Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Mon, 6 Apr 2020 09:26:14 +0900 Subject: [PATCH] Fix memory leak Change-Id: Ie066cf7f4cb2ca091d1625011a637ef1b798fc9a --- dvpnlib/src/dvpnlib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dvpnlib/src/dvpnlib.c b/dvpnlib/src/dvpnlib.c index 8f7f9ad..e8d0b81 100755 --- a/dvpnlib/src/dvpnlib.c +++ b/dvpnlib/src/dvpnlib.c @@ -8,6 +8,7 @@ enum dvpnlib_err common_set_property(GDBusProxy *dbus_proxy, const char *property, GVariant *value) { + GVariant *result; gchar *print_str; GError *error = NULL; enum dvpnlib_err ret = DVPNLIB_ERR_NONE; @@ -18,7 +19,7 @@ enum dvpnlib_err common_set_property(GDBusProxy *dbus_proxy, property, print_str); g_free(print_str); - g_dbus_proxy_call_sync(dbus_proxy, "SetProperty", + result = g_dbus_proxy_call_sync(dbus_proxy, "SetProperty", g_variant_new("(sv)", property, value), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); if (error) { @@ -27,6 +28,8 @@ enum dvpnlib_err common_set_property(GDBusProxy *dbus_proxy, g_error_free(error); } + g_variant_unref(result); + return ret; } -- 2.34.1