From ca913c98a6948f1b4acf38dd548fb6fa0191367c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 30 Jan 2012 14:05:59 +0100 Subject: [PATCH] s3:net ads join: check for success of fetching machine password in dns update block log and cleanup accordingly if failed --- source3/utils/net_ads.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 22486ea7fbd..ddfe10b9143 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1486,6 +1486,11 @@ int net_ads_join(struct net_context *c, int argc, const char **argv) ads_dns->auth.password = secrets_fetch_machine_password( r->out.netbios_domain_name, NULL, NULL); + if (ads_dns->auth.password == NULL) { + d_fprintf(stderr, _("DNS update failed: out of memory\n")); + goto dns_done; + } + ads_dns->auth.realm = SMB_STRDUP(r->out.dns_domain_name); strupper_m(ads_dns->auth.realm); ads_kinit_password(ads_dns); -- 2.11.4.GIT