summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jeremy@jeremy-desktop.(none)>2008-12-23 11:27:19 -0800
committerJeremy Allison <jeremy@jeremy-desktop.(none)>2008-12-23 11:27:19 -0800
commitb143938b8afaa7c7759e09228cc0d92ff97121d0 (patch)
treee9de7fc2f589705c0eadbe28fcbd9e00baff942a /source3/printing
parent7c6a20a439e5e6e9b4149df77896eea57d931e73 (diff)
downloadsamba-b143938b8afaa7c7759e09228cc0d92ff97121d0.tar.gz
samba-b143938b8afaa7c7759e09228cc0d92ff97121d0.tar.bz2
samba-b143938b8afaa7c7759e09228cc0d92ff97121d0.zip
Fix more asprintf errors and error code paths.
Jeremy.
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index ba1fb4352c..2b24fdd923 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3381,7 +3381,7 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
NT_PRINTER_INFO_LEVEL *printer)
{
ADS_STATUS ads_rc;
- LDAPMessage *res;
+ LDAPMessage *res = NULL;
char *prt_dn = NULL;
DEBUG(5, ("unpublishing printer %s\n", printer->info_2->printername));
@@ -3390,7 +3390,7 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
ads_rc = ads_find_printer_on_server(ads, &res,
printer->info_2->sharename, global_myname());
- if (ADS_ERR_OK(ads_rc) && ads_count_replies(ads, res)) {
+ if (ADS_ERR_OK(ads_rc) && res && ads_count_replies(ads, res)) {
prt_dn = ads_get_dn(ads, res);
if (!prt_dn) {
ads_msgfree(ads, res);
@@ -3400,7 +3400,9 @@ static WERROR nt_printer_unpublish_ads(ADS_STRUCT *ads,
ads_memfree(ads, prt_dn);
}
- ads_msgfree(ads, res);
+ if (res) {
+ ads_msgfree(ads, res);
+ }
return WERR_OK;
}