From: Volker Lendecke Date: Sat, 26 Dec 2020 08:27:10 +0000 (+0100) Subject: librpc: Fix an error path memleak X-Git-Tag: samba-4.14.0rc1~146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de9b7312f1d4ba610817ec5189ff48b63e93df95;p=thirdparty%2Fsamba.git librpc: Fix an error path memleak Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c index 064ad38b8d6..9113bf89976 100644 --- a/librpc/rpc/dcesrv_core.c +++ b/librpc/rpc/dcesrv_core.c @@ -2341,7 +2341,10 @@ _PUBLIC_ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, dce_ctx->endpoint_list = NULL; dce_ctx->lp_ctx = lp_ctx; dce_ctx->assoc_groups_idr = idr_init(dce_ctx); - NT_STATUS_HAVE_NO_MEMORY(dce_ctx->assoc_groups_idr); + if (dce_ctx->assoc_groups_idr == NULL) { + TALLOC_FREE(dce_ctx); + return NT_STATUS_NO_MEMORY; + } dce_ctx->broken_connections = NULL; if (cb != NULL) { dce_ctx->callbacks = *cb;