library: fix a memory leak in the `method_call_sync` routine 46/281146/1 accepted/tizen/unified/20220915.015341 accepted/tizen/unified/20220915.023904 accepted/tizen/unified/20220915.025944 submit/tizen/20220913.195454
authorAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 13 Sep 2022 11:36:41 +0000 (13:36 +0200)
committerAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 13 Sep 2022 11:36:41 +0000 (13:36 +0200)
Change-Id: I2d4ae28c363996faf859cc33635bc6c777ef2442

src/library/src/lib.c

index b7f846af99b5ba26a39911778b8c94745c64b373..94b44596d8978e4b09c37002864a828f6d625e2c 100644 (file)
@@ -537,6 +537,8 @@ static int method_call_sync(gchar *method, GVariant *params, const GVariantType
 
        if (!retgv || g_err) {
                LOGE("Error while calling DBus method %s: %s", method, g_dbus_error_get_remote_error(g_err));
+               if (retgv)
+                       g_variant_unref(retgv);
                return gerror_to_errcode(g_err);
        }