summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 14:07:29 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:11:32 +0100
commit63f824c6599fd58fd1427a68569440b37f03769f (patch)
tree2c7f38706be19b6ec651a1d5fa23e9f2b83b96fd
parent08978ddb560ad10e4427fc7b4aaa18cf6912ba0c (diff)
eldbus: create object when needed
We allocate the strbuf at the beginning of the function, but do several return checks after this which does not free the strbuf before return, and we don't use the strbuf. So create the strbuf object after checks, just before we need it. Fixes CID 1039287
-rw-r--r--src/bin/eldbus/parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/eldbus/parser.c b/src/bin/eldbus/parser.c
index 73e4f41426..a74ff07b41 100644
--- a/src/bin/eldbus/parser.c
+++ b/src/bin/eldbus/parser.c
@@ -199,7 +199,7 @@ open_signal(const char *content, unsigned length, Eina_Bool is_open_empty)
199 Eina_Bool r; 199 Eina_Bool r;
200 char *tmp; 200 char *tmp;
201 int i; 201 int i;
202 Eina_Strbuf *buf = eina_strbuf_new(); 202 Eina_Strbuf *buf;
203 203
204 d_signal = signal_new(iface); 204 d_signal = signal_new(iface);
205 EINA_SAFETY_ON_NULL_RETURN_VAL(d_signal, EINA_FALSE); 205 EINA_SAFETY_ON_NULL_RETURN_VAL(d_signal, EINA_FALSE);
@@ -213,6 +213,7 @@ open_signal(const char *content, unsigned length, Eina_Bool is_open_empty)
213 return EINA_FALSE; 213 return EINA_FALSE;
214 } 214 }
215 215
216 buf = eina_strbuf_new();
216 tmp = dbus_name_to_c(d_signal->name); 217 tmp = dbus_name_to_c(d_signal->name);
217 d_signal->c_name = string_build("%s_%s", iface->c_name, tmp); 218 d_signal->c_name = string_build("%s_%s", iface->c_name, tmp);
218 free(tmp); 219 free(tmp);