summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-21 00:17:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:18:54 -0500
commit607f9ffc8e3b4018741db277d9240b2b19c5379e (patch)
treef1c520317e84ad287780579151e51b1eb8d24635
parentadc252c27511b8aee09a8b4ef6e7a50894514837 (diff)
downloadsamba-607f9ffc8e3b4018741db277d9240b2b19c5379e.tar.gz
samba-607f9ffc8e3b4018741db277d9240b2b19c5379e.tar.bz2
samba-607f9ffc8e3b4018741db277d9240b2b19c5379e.zip
r16433: Fix Coverity #300 (triggered by a Klockwork bugfix
I think). If a alloc fails just return NT_STATUS_NO_MEMORY, don't go to "done" label and deref pointers. Jeremy. (This used to be commit 490c7c84674860ecd9daa24341edb427b9fe0aa5)
-rw-r--r--source3/rpc_server/srv_lsa_nt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index ae9795952c..efa7156eea 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -1135,7 +1135,7 @@ NTSTATUS _lsa_lookup_names2(pipes_struct *p, LSA_Q_LOOKUP_NAMES2 *q_u, LSA_R_LOO
if ((ref == NULL) || (rids == NULL) || (rids2 == NULL)) {
r_u->status = NT_STATUS_NO_MEMORY;
- goto done;
+ return NT_STATUS_NO_MEMORY;
}
if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle)) {
@@ -1149,10 +1149,6 @@ NTSTATUS _lsa_lookup_names2(pipes_struct *p, LSA_Q_LOOKUP_NAMES2 *q_u, LSA_R_LOO
goto done;
}
- if (!ref || !rids || !rids2) {
- return NT_STATUS_NO_MEMORY;
- }
-
/* set up the LSA Lookup RIDs response */
become_root(); /* lookup_name can require root privs */
r_u->status = lookup_lsa_rids(p->mem_ctx, ref, rids, num_entries,