r22811: two more memory allocation checks.
authorRafal Szczesniak <mimir@samba.org>
Fri, 11 May 2007 21:51:53 +0000 (21:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:52:19 +0000 (14:52 -0500)
rafal
(This used to be commit d66b13f6facdba407604f33211574f43163b186c)

source4/libnet/libnet_lookup.c
source4/libnet/userinfo.c

index 1c60bfc41d8fdf338da5a4237c6898ee489f5285..c8dc7267643a896df7d8e34df984a0659080868c 100644 (file)
@@ -74,6 +74,8 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
 
        /* 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;
 
index 03dc0d8fad788f967c9496e13a64627a2ec64283..057e13d3b1b6d8aec8b80587093cbbd17d24d409 100644 (file)
@@ -296,9 +296,10 @@ struct composite_context *libnet_rpc_userinfo_send(struct dcerpc_pipe *p,
                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);