From 576e17cbf3fe10cb8338ab00eeea6211266af390 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 31 Mar 2006 00:47:08 +0000 Subject: r14831: Fix possible null deref. Coverity #279. Jeremy. (This used to be commit 75be5c17bc74c86219c7cac749b52b7d43abb780) --- source3/utils/net_ads.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3') diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 5f5e1aa5ea..dd53cc5289 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1045,6 +1045,13 @@ static int net_ads_printer_publish(int argc, const char **argv) asprintf(&prt_dn, "cn=%s-%s,%s", srv_cn[0], printername, srv_dn); pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SPOOLSS, &nt_status); + if (!pipe_hnd) { + d_fprintf(stderr, "Unable to open a connnection to the spoolss pipe on %s\n", + servername); + ads_destroy(&ads); + return -1; + } + get_remote_printer_publishing_data(pipe_hnd, mem_ctx, &mods, printername); -- cgit