The caller should not dereference lock_ctx after invoking
process_callbacks(), it might be destroyed already.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jun 12 15:28:57 CEST 2015 on sn-devel-104
(Imported from commit
b3a18d66c00dba73a3f56a6f95781b4d34db1fe2)
break;
}
}
+
+ talloc_free(lock_ctx);
}
void *private_data)
{
struct lock_context *lock_ctx;
- TALLOC_CTX *tmp_ctx = NULL;
char c;
bool locked;
double t;
t = timeval_elapsed(&lock_ctx->start_time);
id = lock_bucket_id(t);
- if (lock_ctx->auto_mark) {
- tmp_ctx = talloc_new(ev);
- talloc_steal(tmp_ctx, lock_ctx);
- }
-
/* Read the status from the child process */
if (sys_read(lock_ctx->fd[0], &c, 1) != 1) {
locked = false;
}
process_callbacks(lock_ctx, locked);
-
- if (lock_ctx->auto_mark) {
- talloc_free(tmp_ctx);
- }
}