From: Swen Schillig Date: Thu, 1 Feb 2018 08:39:02 +0000 (+0100) Subject: Replace NT_STATUS_HAVE_NO_MEMORY macro X-Git-Tag: talloc-2.1.12~280 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e01d7d9d0f76b5624bc10d94965fad8f22b4ea7b;p=thirdparty%2Fsamba.git Replace NT_STATUS_HAVE_NO_MEMORY macro Replaced NT_STATUS_HAVE_NO_MEMORY macro and fixed memory leaking error-path. Signed-off-by: Swen Schillig Reviewed-by: Ralph Boehme Reviewed-by: Christof Schmitt Autobuild-User(master): Christof Schmitt Autobuild-Date(master): Sat Mar 3 00:00:34 CET 2018 on sn-devel-144 --- diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index c4befcacda9..63ce6015b66 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -419,9 +419,15 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx if (domains->count > 0) { io->out.sid = dom_sid_add_rid(mem_ctx, domains->domains[0].sid, io->out.rid); - NT_STATUS_HAVE_NO_MEMORY(io->out.sid); + if (io->out.sid == NULL) { + status = NT_STATUS_NO_MEMORY; + goto done; + } io->out.sidstr = dom_sid_string(mem_ctx, io->out.sid); - NT_STATUS_HAVE_NO_MEMORY(io->out.sidstr); + if (io->out.sidstr == NULL) { + status = NT_STATUS_NO_MEMORY; + goto done; + } } success: