diff options
author | Jeremy Allison <jra@samba.org> | 2000-09-11 23:43:44 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-09-11 23:43:44 +0000 |
commit | d836024b2816f37abd523afb3b2d4f2bfb130f0a (patch) | |
tree | d2e85f763ad99dc90a6909dcebc2cb530a48ed3f /source3/rpc_server | |
parent | 692fe0cabfaf4b0e13083aa5d6fc9dddb4e5dd5b (diff) | |
download | samba-d836024b2816f37abd523afb3b2d4f2bfb130f0a.tar.gz samba-d836024b2816f37abd523afb3b2d4f2bfb130f0a.tar.bz2 samba-d836024b2816f37abd523afb3b2d4f2bfb130f0a.zip |
Fixed memory leaks found in enumprinterdrivers code.
Jeremy.
(This used to be commit e08b521559a824da09b0b73a04e462c573c42b06)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index da5b3e960f..7f7a75fc5c 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -3677,7 +3677,8 @@ static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); get_a_printer_driver(&driver, 3, list[i], architecture, version); - fill_printer_driver_info_1(&(driver_info_1[*returned+i]), driver, servername, architecture ); + fill_printer_driver_info_1(&driver_info_1[*returned+i], driver, servername, architecture ); + free_a_printer_driver(driver, 3); } *returned+=ndrivers; @@ -3687,7 +3688,7 @@ static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture /* check the required size. */ for (i=0; i<*returned; i++) { DEBUGADD(6,("adding driver [%d]'s size\n",i)); - *needed += spoolss_size_printer_driver_info_1(&(driver_info_1[i])); + *needed += spoolss_size_printer_driver_info_1(&driver_info_1[i]); } if (!alloc_buffer_size(buffer, *needed)) { @@ -3698,7 +3699,7 @@ static uint32 enumprinterdrivers_level1(fstring servername, fstring architecture /* fill the buffer with the form structures */ for (i=0; i<*returned; i++) { DEBUGADD(6,("adding driver [%d] to buffer\n",i)); - new_smb_io_printer_driver_info_1("", buffer, &(driver_info_1[i]), 0); + new_smb_io_printer_driver_info_1("", buffer, &driver_info_1[i], 0); } safe_free(driver_info_1); @@ -3747,7 +3748,8 @@ static uint32 enumprinterdrivers_level2(fstring servername, fstring architecture DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); get_a_printer_driver(&driver, 3, list[i], architecture, version); - fill_printer_driver_info_2(&(driver_info_2[*returned+i]), driver, servername); + fill_printer_driver_info_2(&driver_info_2[*returned+i], driver, servername); + free_a_printer_driver(driver, 3); } *returned+=ndrivers; @@ -3817,7 +3819,8 @@ static uint32 enumprinterdrivers_level3(fstring servername, fstring architecture DEBUGADD(5,("\tdriver: [%s]\n", list[i])); ZERO_STRUCT(driver); get_a_printer_driver(&driver, 3, list[i], architecture, version); - fill_printer_driver_info_3(&(driver_info_3[*returned+i]), driver, servername); + fill_printer_driver_info_3(&driver_info_3[*returned+i], driver, servername); + free_a_printer_driver(driver, 3); } *returned+=ndrivers; |