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

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

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:
   branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2006-06-21 00:17:08 UTC 
(rev 16432)
+++ branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2006-06-21 00:17:14 UTC 
(rev 16433)
@@ -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