summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-17 02:22:35 +0000
committerJeremy Allison <jra@samba.org>2000-11-17 02:22:35 +0000
commit475fb713a9427b54c747a4e71a011c7db29d5e13 (patch)
tree201275f216533a9e30675ce35a6f8d21595ab8fb /source3/printing/nt_printing.c
parent08036f0f3d3a1dbddc6b3aaba976670e80e47cab (diff)
downloadsamba-475fb713a9427b54c747a4e71a011c7db29d5e13.tar.gz
samba-475fb713a9427b54c747a4e71a011c7db29d5e13.tar.bz2
samba-475fb713a9427b54c747a4e71a011c7db29d5e13.zip
Fix for memory leak when adding driver.
Jeremy. (This used to be commit eeab4e0290f9df84025e91c85d27b21e0c02781f)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 34d9538752..bbe01b87f6 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1777,17 +1777,17 @@ static uint32 update_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info)
/****************************************************************************
****************************************************************************/
-BOOL add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *param)
+void add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM **param)
{
NT_PRINTER_PARAM *current;
DEBUG(108,("add_a_specific_param\n"));
- param->next=NULL;
+ (*param)->next=NULL;
if (info_2->specific == NULL)
{
- info_2->specific=param;
+ info_2->specific=*param;
}
else
{
@@ -1795,9 +1795,10 @@ BOOL add_a_specific_param(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_PARAM *par
while (current->next != NULL) {
current=current->next;
}
- current->next=param;
+ current->next=*param;
}
- return (True);
+
+ *param = NULL;
}
/****************************************************************************
@@ -1844,7 +1845,7 @@ BOOL unlink_specific_param_if_exist(NT_PRINTER_INFO_LEVEL_2 *info_2, NT_PRINTER_
/****************************************************************************
Clean up and deallocate a (maybe partially) allocated NT_PRINTER_PARAM.
****************************************************************************/
-static void free_nt_printer_param(NT_PRINTER_PARAM **param_ptr)
+void free_nt_printer_param(NT_PRINTER_PARAM **param_ptr)
{
NT_PRINTER_PARAM *param = *param_ptr;