summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>1999-09-27 13:12:55 +0000
committerJean-François Micouleau <jfm@samba.org>1999-09-27 13:12:55 +0000
commited5fbd743be07a3c6e1a3879df283d0222ef0eb5 (patch)
tree17959ac98230e9d243f459b19a6961d6c8180b34 /source3/printing
parent0490365b04564750d73eea36af0ba1444d1d3d77 (diff)
downloadsamba-ed5fbd743be07a3c6e1a3879df283d0222ef0eb5.tar.gz
samba-ed5fbd743be07a3c6e1a3879df283d0222ef0eb5.tar.bz2
samba-ed5fbd743be07a3c6e1a3879df283d0222ef0eb5.zip
don't leak printer handles,
don't coredump when adding forms, and a small non obvious memory leak in the rpc buffers J.F. (This used to be commit bee11f8889378b9f1cc6e2818fd0f8dd7ddcf10d)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index a384b8e31a..90a53f1f7c 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -126,7 +126,7 @@ int write_ntforms(nt_forms_struct **list, int number)
/****************************************************************************
add a form struct at the end of the list
****************************************************************************/
-void add_a_form(nt_forms_struct **list, FORM form, int count)
+void add_a_form(nt_forms_struct **list, FORM form, int *count)
{
int n=0;
BOOL update;
@@ -141,7 +141,7 @@ void add_a_form(nt_forms_struct **list, FORM form, int count)
update=False;
unistr2_to_ascii(form_name, &(form.name), sizeof(form_name)-1);
- for (n=0; n<count && update==False; n++)
+ for (n=0; n<*count && update==False; n++)
{
if (!strncmp((*list)[n].name, form_name, strlen(form_name)))
{
@@ -154,6 +154,7 @@ void add_a_form(nt_forms_struct **list, FORM form, int count)
{
*list=Realloc(*list, (n+1)*sizeof(nt_forms_struct));
unistr2_to_ascii((*list)[n].name, &(form.name), sizeof((*list)[n].name)-1);
+ (*count)++;
}
(*list)[n].flag=form.flags;
@@ -163,7 +164,6 @@ void add_a_form(nt_forms_struct **list, FORM form, int count)
(*list)[n].top=form.top;
(*list)[n].right=form.right;
(*list)[n].bottom=form.bottom;
-
}
/****************************************************************************