Author: jra
Date: 2006-03-31 00:47:19 +0000 (Fri, 31 Mar 2006)
New Revision: 14832

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14832

Log:
Fix possible null deref. Coverity #279.
Jeremy.

Modified:
   trunk/source/utils/net_ads.c


Changeset:
Modified: trunk/source/utils/net_ads.c
===================================================================
--- trunk/source/utils/net_ads.c        2006-03-31 00:47:08 UTC (rev 14831)
+++ trunk/source/utils/net_ads.c        2006-03-31 00:47:19 UTC (rev 14832)
@@ -1045,6 +1045,13 @@
        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);
 

Reply via email to