dbus-handler: Free memory before exiting the function 75/318075/1
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 13 Jan 2025 04:27:49 +0000 (13:27 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 13 Jan 2025 04:28:12 +0000 (13:28 +0900)
Free memory of builder before exiting the function by error.
g_variant_builder_clear() frees memory of builder properly.

Change-Id: Ied3516e402d94f44b2d350377c64a0ead1d517cc
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/common/ipc/dbus-handler.c

index 942788be7c7f47c7a91796b35be8cb579f391ced..f21ff07c31ea74fe59d22d36349e8db604b01fd8 100644 (file)
@@ -167,6 +167,7 @@ static GVariant *append_variant(const char *sig, char *param[])
                        }
                        break;
                default:
+                       g_variant_builder_clear(&builder);
                        return NULL;
                }
        }