[Coverity CID: 1025913] Fixed resource leak issue. 63/188863/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.015039 accepted/tizen/unified/20180912.061701 submit/tizen/20180911.120738 submit/tizen_5.0/20181101.000003
authorNishant Chaprana <n.chaprana@samsung.com>
Tue, 11 Sep 2018 06:39:46 +0000 (12:09 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Tue, 11 Sep 2018 06:39:50 +0000 (12:09 +0530)
Change-Id: Ifc4e5c7982c110ee55ae3addffef09fb5824a938
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/libnet-client.spec
src/network-dbus-request.c

index 093f842..9008c2c 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          libnet-client
 Summary:       Network Client library (Shared library)
-Version:       1.1.69
+Version:       1.1.70
 Release:       1
 Group:         System/Network
 License:       Flora-1.1
index 5097fa8..5efe355 100755 (executable)
@@ -741,6 +741,7 @@ int _net_dbus_set_mesh_property(char* profile_name, const char *property,
 
        GVariant *params = NULL;
        GVariant *message = NULL;
+       GVariant *str_var = NULL;
 
        NETWORK_LOG(NETWORK_HIGH, "profile_name: [%s]", profile_name);
 
@@ -750,12 +751,15 @@ int _net_dbus_set_mesh_property(char* profile_name, const char *property,
                return NET_ERR_INVALID_PARAM;
        }
 
-
-       params = g_variant_new("(sv)", property, g_variant_new_string(value));
+       str_var = g_variant_ref_sink(g_variant_new_string(value));
+       params = g_variant_new("(sv)", property, str_var);
 
        message = _net_invoke_dbus_method(CONNMAN_SERVICE, profile_name,
                        CONNMAN_MESH_INTERFACE, "SetProperty", params,
                        &Error);
+
+       g_variant_unref(str_var);
+
        if (message == NULL) {
                NETWORK_LOG(NETWORK_ERROR, "Failed to set Mesh %s Property", property);
                __NETWORK_FUNC_EXIT__;