summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2021-07-16 15:00:58 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2021-07-16 15:36:50 +0900
commitfed4271f46672abb75e6411b92c394a3fdd22fa0 (patch)
tree9da5304a1dc0f9c0f843188a988e3125480e2a08
parenta81adde463f2838290653ff5b9b688e9a357a83a (diff)
downloadtidl-fed4271f46672abb75e6411b92c394a3fdd22fa0.tar.gz
tidl-fed4271f46672abb75e6411b92c394a3fdd22fa0.tar.bz2
tidl-fed4271f46672abb75e6411b92c394a3fdd22fa0.zip
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 <h.jhun@samsung.com>
-rw-r--r--idlc/gen/c_body_gen_base.cc4
1 files 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;
});