svn commit: samba r22811 - in branches/SAMBA_4_0/source/libnet: . Author: mimir
Date: 2007-05-11 21:51:53 +0000 (Fri, 11 May 2007)
New Revision: 22811

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

Log:
two more memory allocation checks.


rafal


Modified:
   branches/SAMBA_4_0/source/libnet/libnet_lookup.c
   branches/SAMBA_4_0/source/libnet/userinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_lookup.c	2007-05-11 21:48:29 UTC (rev 22810)
+++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c	2007-05-11 21:51:53 UTC (rev 22811)
@@ -74,6 +74,8 @@
 
 	/* parameters */
 	s->hostname.name   = talloc_strdup(s, io->in.hostname);
+	if (composite_nomem(s->hostname.name, c)) return c;
+
 	s->hostname.type   = io->in.type;
 	s->hostname.scope  = NULL;
 

Modified: branches/SAMBA_4_0/source/libnet/userinfo.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/userinfo.c	2007-05-11 21:48:29 UTC (rev 22810)
+++ branches/SAMBA_4_0/source/libnet/userinfo.c	2007-05-11 21:51:53 UTC (rev 22811)
@@ -296,9 +296,10 @@
 		s->lookup.in.domain_handle    = &s->domain_handle;
 		s->lookup.in.num_names        = 1;
 		s->lookup.in.names            = talloc_array(s, struct lsa_String, 1);
-		
 		if (composite_nomem(s->lookup.in.names, c)) return c;
+
 		s->lookup.in.names[0].string  = talloc_strdup(s, io->in.username);
+		if (composite_nomem(s->lookup.in.names[0].string, c)) return c;
 		
 		/* send request */
 		lookup_req = dcerpc_samr_LookupNames_send(p, c, &s->lookup);

