From: Hwankyu Jhun Date: Fri, 16 Jul 2021 06:00:58 +0000 (+0900) Subject: Fix bugs of C Generator X-Git-Tag: accepted/tizen/unified/20210719.025302~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fed4271f46672abb75e6411b92c394a3fdd22fa0;p=platform%2Fcore%2Fappfw%2Ftidl.git 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 --- 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; });