summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-05-13 17:17:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:01 -0500
commit58959676012bd1636cadc72415aa18c728287fc1 (patch)
tree470798bc6d55ec384a59f82d1c421ab5b640f015 /source3/printing
parentf390936c5b77c74717c364f0685f5be914daad1b (diff)
downloadsamba-58959676012bd1636cadc72415aa18c728287fc1.tar.gz
samba-58959676012bd1636cadc72415aa18c728287fc1.tar.bz2
samba-58959676012bd1636cadc72415aa18c728287fc1.zip
r15569: Fix Coverity bug # 287. Jerry, can you check if WERR_NOMEM is a correct error
code here? Thanks, Volker (This used to be commit 5787bd0ee90b081ae12a4a976893cb297fa7bed4)
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);