summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b0bac86dad..79061ebd41 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3020,8 +3020,19 @@ static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
/* build the ads mods */
ctx = talloc_init("nt_printer_publish_ads");
+ if (ctx == NULL) {
+ SAFE_FREE(prt_dn);
+ return WERR_NOMEM;
+ }
+
mods = ads_init_mods(ctx);
+ if (mods == NULL) {
+ SAFE_FREE(prt_dn);
+ talloc_destroy(ctx);
+ return WERR_NOMEM;
+ }
+
get_local_printer_publishing_data(ctx, &mods, printer->info_2->data);
ads_mod_str(ctx, &mods, SPOOL_REG_PRINTERNAME,
printer->info_2->sharename);