Author: jra
Date: 2006-06-21 00:17:08 +0000 (Wed, 21 Jun 2006)
New Revision: 16432

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16432

Log:
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.

Modified:
   trunk/source/rpc_server/srv_lsa_nt.c


Changeset:
Modified: trunk/source/rpc_server/srv_lsa_nt.c
===================================================================
--- trunk/source/rpc_server/srv_lsa_nt.c        2006-06-20 22:37:56 UTC (rev 
16431)
+++ trunk/source/rpc_server/srv_lsa_nt.c        2006-06-21 00:17:08 UTC (rev 
16432)
@@ -1135,7 +1135,7 @@
 
        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 @@
                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,

Reply via email to