diff options
author | Adam Michalski <a.michalski2@partner.samsung.com> | 2023-06-30 14:51:24 +0200 |
---|---|---|
committer | Adam Michalski <a.michalski2@partner.samsung.com> | 2023-06-30 14:51:24 +0200 |
commit | 0aa025b08e3de1cfd5fe054ce226779cd60ab584 (patch) | |
tree | 02a4ad329941420ee16c70cbd5aa762a82247658 | |
parent | 7c9c65b3344cae9177830c83b6ace8f70404f070 (diff) | |
download | sessiond-0aa025b08e3de1cfd5fe054ce226779cd60ab584.tar.gz sessiond-0aa025b08e3de1cfd5fe054ce226779cd60ab584.tar.bz2 sessiond-0aa025b08e3de1cfd5fe054ce226779cd60ab584.zip |
sessiond: Fix a memory leaktizen_8.0_m2_releaseaccepted/tizen/unified/20230706.152121accepted/tizen/8.0/unified/20231005.093843
Change-Id: I758a664f234206809310bf8074de7537746e2937
-rw-r--r-- | src/service/src/tuple_g_variant_helpers.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/service/src/tuple_g_variant_helpers.hpp b/src/service/src/tuple_g_variant_helpers.hpp index 52fac01..2466ca0 100644 --- a/src/service/src/tuple_g_variant_helpers.hpp +++ b/src/service/src/tuple_g_variant_helpers.hpp @@ -119,9 +119,13 @@ std::tuple<T, T1, Ts...> tuple_from_g_variant_inner(GVariant *variant) template <typename... Ts> std::tuple<Ts...> tuple_from_g_variant(GVariant *variant) { - if (!g_variant_is_of_type(variant, g_variant_type_new(type_of_g_variant<Ts...>().c_str()))) + GVariantType *type = g_variant_type_new(type_of_g_variant<Ts...>().c_str()); + if (!g_variant_is_of_type(variant, type)) { + g_variant_type_free(type); throw std::system_error(std::error_code(), "Invalid parameters type"); + } + g_variant_type_free(type); return tuple_from_g_variant_inner<0, Ts...>(variant); } |