summaryrefslogtreecommitdiff
path: root/src/bin/eldbus
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-11-24 09:54:06 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2014-11-24 10:14:15 +0100
commit8595e0632e54fc54212a24e4125792532bbd7d69 (patch)
treeb7ea85724dfaa6eb822db6055ca995e87759ca45 /src/bin/eldbus
parent516691de9bd0fccd8ce1113de466862b4367141f (diff)
eldbus-codegen: Free msg on error path for generated code.
If eldbus_message_arguments_append we would never unref the message. This will fix various Coverity issues in generatd eldbus code. @fix CID: 1255634, 1255636, 1255637, 1255639
Diffstat (limited to 'src/bin/eldbus')
-rw-r--r--src/bin/eldbus/source_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/eldbus/source_client.c b/src/bin/eldbus/source_client.c
index 50c0188..07f5773 100644
--- a/src/bin/eldbus/source_client.c
+++ b/src/bin/eldbus/source_client.c
@@ -161,6 +161,7 @@ source_client_simple_method_call_no_reply_generate(const DBus_Method *method, Ei
161 eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call)); 161 eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
162 eina_strbuf_append_printf(c_code, " {\n"); 162 eina_strbuf_append_printf(c_code, " {\n");
163 eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n"); 163 eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n");
164 eina_strbuf_append_printf(c_code, " eldbus_message_unref(msg);\n");
164 eina_strbuf_append_printf(c_code, " return;\n"); 165 eina_strbuf_append_printf(c_code, " return;\n");
165 eina_strbuf_append_printf(c_code, " }\n"); 166 eina_strbuf_append_printf(c_code, " }\n");
166 eina_strbuf_append_printf(c_code, " eldbus_proxy_send(proxy, msg, NULL, NULL, -1);\n"); 167 eina_strbuf_append_printf(c_code, " eldbus_proxy_send(proxy, msg, NULL, NULL, -1);\n");
@@ -201,6 +202,7 @@ source_client_simple_method_call_generate(const DBus_Method *method, Eina_Strbuf
201 eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call)); 202 eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
202 eina_strbuf_append_printf(c_code, " {\n"); 203 eina_strbuf_append_printf(c_code, " {\n");
203 eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n"); 204 eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n");
205 eina_strbuf_append_printf(c_code, " eldbus_message_unref(msg);\n");
204 eina_strbuf_append_printf(c_code, " return NULL;\n"); 206 eina_strbuf_append_printf(c_code, " return NULL;\n");
205 eina_strbuf_append_printf(c_code, " }\n"); 207 eina_strbuf_append_printf(c_code, " }\n");
206 eina_strbuf_append_printf(c_code, " p = eldbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name); 208 eina_strbuf_append_printf(c_code, " p = eldbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);