summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-01-30 14:07:52 +0100
committerMichael Adam <obnox@samba.org>2012-01-31 17:00:30 +0100
commit4831b6e6bb422a9186cf42980894b5e46c147ed4 (patch)
tree17b5e03b3fb166190d52b80ffe3e94b08e844df3
parentca913c98a6948f1b4acf38dd548fb6fa0191367c (diff)
downloadsamba-4831b6e6bb422a9186cf42980894b5e46c147ed4.tar.gz
samba-4831b6e6bb422a9186cf42980894b5e46c147ed4.tar.bz2
samba-4831b6e6bb422a9186cf42980894b5e46c147ed4.zip
s3:net ads join: check for malloc success and react accordingly in dns update block
-rw-r--r--source3/utils/net_ads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index ddfe10b914..cb15b76a28 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -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);