summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-30 03:45:21 +0000
committerJeremy Allison <jra@samba.org>2001-11-30 03:45:21 +0000
commit605248abd9cf207d80811e304a61e0417999ac1c (patch)
tree31f80a5eaca4a2e6bae4b5c0bf6e4d0c3a448546
parent445ab75ec33db60307a373885efe622ed5c65d02 (diff)
downloadsamba-605248abd9cf207d80811e304a61e0417999ac1c.tar.gz
samba-605248abd9cf207d80811e304a61e0417999ac1c.tar.bz2
samba-605248abd9cf207d80811e304a61e0417999ac1c.zip
Check error returns.
Jeremy. (This used to be commit fc8638e89effb0ebf2e40cee8cd0d7467e49e2a8)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 3c7948fd7b..7f54867eb4 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -908,15 +908,17 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u,
static BOOL convert_printer_info(const SPOOL_PRINTER_INFO_LEVEL *uni,
NT_PRINTER_INFO_LEVEL *printer, uint32 level)
{
+ BOOL ret = True;
+
switch (level) {
case 2:
- uni_2_asc_printer_info_2(uni->info_2, &printer->info_2);
+ ret = uni_2_asc_printer_info_2(uni->info_2, &printer->info_2);
break;
default:
break;
}
- return True;
+ return ret;
}
static BOOL convert_printer_driver_info(const SPOOL_PRINTER_DRIVER_INFO_LEVEL *uni,
@@ -4569,7 +4571,10 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
* just read from the tdb in the pointer 'printer'.
*/
- convert_printer_info(info, printer, level);
+ if (!convert_printer_info(info, printer, level)) {
+ result = WERR_NOMEM;
+ goto done;
+ }
if (info->info_2->devmode_ptr != 0) {
/* we have a valid devmode
@@ -5749,7 +5754,10 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
ZERO_STRUCTP(printer);
/* convert from UNICODE to ASCII - this allocates the info_2 struct inside *printer.*/
- convert_printer_info(info, printer, 2);
+ if (!convert_printer_info(info, printer, 2)) {
+ free_a_printer(&printer, 2);
+ return WERR_NOMEM;
+ }
/* check to see if the printer already exists */