forked from enlightenment/efl
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
This commit is contained in:
parent
08978ddb56
commit
63f824c659
|
@ -199,7 +199,7 @@ open_signal(const char *content, unsigned length, Eina_Bool is_open_empty)
|
||||||
Eina_Bool r;
|
Eina_Bool r;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int i;
|
int i;
|
||||||
Eina_Strbuf *buf = eina_strbuf_new();
|
Eina_Strbuf *buf;
|
||||||
|
|
||||||
d_signal = signal_new(iface);
|
d_signal = signal_new(iface);
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(d_signal, EINA_FALSE);
|
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)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf = eina_strbuf_new();
|
||||||
tmp = dbus_name_to_c(d_signal->name);
|
tmp = dbus_name_to_c(d_signal->name);
|
||||||
d_signal->c_name = string_build("%s_%s", iface->c_name, tmp);
|
d_signal->c_name = string_build("%s_%s", iface->c_name, tmp);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
Loading…
Reference in New Issue