In case check_ctx_create in net_registry_check_db() returns NULL,
the pointer ctx is NULL and execution jumps to 'done' label,
where function check_ctx_transaction_stop is called.
In this fuction the ctx pointer is dereferenced instantly,
so the NULL pointer will be dereferenced.
In case check_ctx_create returns NULL,
we can just return -1 from net_registry_check_db.
Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
NTSTATUS status;
int ret = -1;
struct check_ctx *ctx = check_ctx_create(talloc_tos(), name, opt);
- if (ctx==NULL) {
- goto done;
+ if (ctx == NULL) {
+ return ret;
}
d_printf("Check database: %s\n", name);