diff options
author | Jeremy Allison <jra@samba.org> | 2006-07-25 21:33:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:21 -0500 |
commit | 29a4d666bad176483a5a346d24dc1b044bf67b2b (patch) | |
tree | 61230fe9597e41be61074aed6896f8bba988589c /source3/rpc_server | |
parent | 9d4fa2b27b746d6a5716bfa049b2a1ee191ba6d5 (diff) | |
download | samba-29a4d666bad176483a5a346d24dc1b044bf67b2b.tar.gz samba-29a4d666bad176483a5a346d24dc1b044bf67b2b.tar.bz2 samba-29a4d666bad176483a5a346d24dc1b044bf67b2b.zip |
r17245: Second part of fix for #3962. Don't do a double
free in the infolevel2 case. Free both queue and
NT_PRINTER_INFO_LEVEL in the same place.
Jeremy.
(This used to be commit 6ac3a4ce78f42949013ae7bd675ff292fb0383ca)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index db098e74be..cd0a4f2bb3 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -6395,9 +6395,9 @@ WERROR _spoolss_addjob(pipes_struct *p, SPOOL_Q_ADDJOB *q_u, SPOOL_R_ADDJOB *r_u /**************************************************************************** ****************************************************************************/ -static void fill_job_info_1(JOB_INFO_1 *job_info, print_queue_struct *queue, +static void fill_job_info_1(JOB_INFO_1 *job_info, const print_queue_struct *queue, int position, int snum, - NT_PRINTER_INFO_LEVEL *ntprinter) + const NT_PRINTER_INFO_LEVEL *ntprinter) { struct tm *t; @@ -6422,9 +6422,9 @@ static void fill_job_info_1(JOB_INFO_1 *job_info, print_queue_struct *queue, /**************************************************************************** ****************************************************************************/ -static BOOL fill_job_info_2(JOB_INFO_2 *job_info, print_queue_struct *queue, +static BOOL fill_job_info_2(JOB_INFO_2 *job_info, const print_queue_struct *queue, int position, int snum, - NT_PRINTER_INFO_LEVEL *ntprinter, + const NT_PRINTER_INFO_LEVEL *ntprinter, DEVICEMODE *devmode) { struct tm *t; @@ -6467,8 +6467,8 @@ static BOOL fill_job_info_2(JOB_INFO_2 *job_info, print_queue_struct *queue, Enumjobs at level 1. ****************************************************************************/ -static WERROR enumjobs_level1(print_queue_struct *queue, int snum, - NT_PRINTER_INFO_LEVEL *ntprinter, +static WERROR enumjobs_level1(const print_queue_struct *queue, int snum, + const NT_PRINTER_INFO_LEVEL *ntprinter, RPC_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -6478,7 +6478,6 @@ static WERROR enumjobs_level1(print_queue_struct *queue, int snum, info=SMB_MALLOC_ARRAY(JOB_INFO_1,*returned); if (info==NULL) { - SAFE_FREE(queue); *returned=0; return WERR_NOMEM; } @@ -6486,8 +6485,6 @@ static WERROR enumjobs_level1(print_queue_struct *queue, int snum, for (i=0; i<*returned; i++) fill_job_info_1( &info[i], &queue[i], i, snum, ntprinter ); - SAFE_FREE(queue); - /* check the required size. */ for (i=0; i<*returned; i++) (*needed) += spoolss_size_job_info_1(&info[i]); @@ -6520,8 +6517,8 @@ out: Enumjobs at level 2. ****************************************************************************/ -static WERROR enumjobs_level2(print_queue_struct *queue, int snum, - NT_PRINTER_INFO_LEVEL *ntprinter, +static WERROR enumjobs_level2(const print_queue_struct *queue, int snum, + const NT_PRINTER_INFO_LEVEL *ntprinter, RPC_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { @@ -6542,9 +6539,6 @@ static WERROR enumjobs_level2(print_queue_struct *queue, int snum, for (i=0; i<*returned; i++) fill_job_info_2(&(info[i]), &queue[i], i, snum, ntprinter, devmode); - free_a_printer(&ntprinter, 2); - SAFE_FREE(queue); - /* check the required size. */ for (i=0; i<*returned; i++) (*needed) += spoolss_size_job_info_2(&info[i]); |