s3:net ads join: check for malloc success and react accordingly in dns update block
authorMichael Adam <obnox@samba.org>
Mon, 30 Jan 2012 13:07:52 +0000 (14:07 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 31 Jan 2012 16:00:30 +0000 (17:00 +0100)
source3/utils/net_ads.c

index ddfe10b9143c34851c4bcc4c81bb571e9c79a194..cb15b76a28c26245b7c92755399edcd9afcf77e7 100644 (file)
@@ -1492,6 +1492,11 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
                }
 
                ads_dns->auth.realm = SMB_STRDUP(r->out.dns_domain_name);
+               if (ads_dns->auth.realm == NULL) {
+                       d_fprintf(stderr, _("DNS update failed: out of memory\n"));
+                       goto dns_done;
+               }
+
                strupper_m(ads_dns->auth.realm);
                ads_kinit_password(ads_dns);