summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2018-02-01 09:39:02 +0100
committerChristof Schmitt <cs@samba.org>2018-03-03 00:00:34 +0100
commite01d7d9d0f76b5624bc10d94965fad8f22b4ea7b (patch)
tree8d1aeba05bd4ef627933dd6db75e7b9d3624ad42 /source4/libnet
parent6d0b6e937a55c55797f1d1136c3f75d27d6fa0d3 (diff)
downloadsamba-e01d7d9d0f76b5624bc10d94965fad8f22b4ea7b.tar.gz
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 <swen@vnet.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sat Mar 3 00:00:34 CET 2018 on sn-devel-144
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_lookup.c10
1 files changed, 8 insertions, 2 deletions
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: