From fed4271f46672abb75e6411b92c394a3fdd22fa0 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 16 Jul 2021 15:00:58 +0900 Subject: [PATCH] Fix bugs of C Generator The exception handling of getter is wrong. The function has to release the allocated memory if Out-of-Memory error occurs. Change-Id: I799f3ad9424210c0cae10973523f2022614c4cf0 Signed-off-by: Hwankyu Jhun --- idlc/gen/c_body_gen_base.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idlc/gen/c_body_gen_base.cc b/idlc/gen/c_body_gen_base.cc index f555c26..8d1273e 100644 --- a/idlc/gen/c_body_gen_base.cc +++ b/idlc/gen/c_body_gen_base.cc @@ -904,8 +904,8 @@ std::string CBodyGeneratorBase::GetGetterString(const std::string& id, [&]()->std::string { std::string r; r += "_E(\"Failed to clone " + id + "\");" + NLine(1); - r += GetFinalizeString(id, type, "h->") + NLine(1); - r += GetSetterString("h->" + id, "NULL") + NLine(1); + r += GetFinalizeString("*" + id, type, "") + NLine(1); + r += GetSetterString("*" + id, "NULL") + NLine(1); r += "return -1;"; return r; }); -- 2.7.4