size_t len;
int ret;
uint32_t timed_out;
- struct timed_event *te=NULL;
/* if the domain socket is not yet open, open it */
if (ctdb->daemon.sd==-1) {
/* semi-async operation */
timed_out = 0;
if (timeout) {
- te=event_add_timed(ctdb->ev, mem_ctx, *timeout, timeout_func, &timed_out);
+ event_add_timed(ctdb->ev, state, *timeout, timeout_func, &timed_out);
}
while ((state->state == CTDB_CALL_WAIT)
&& (timed_out == 0) ){
return -1;
}
- if ((timed_out==0) && te) {
- talloc_free(te);
- }
-
if (outdata) {
*outdata = state->outdata;
outdata->dptr = talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);