[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-4927-g97f1514
Günther Deschner
gd at samba.org
Tue Feb 10 09:59:47 GMT 2009
The branch, v3-3-test has been updated
via 97f1514ce95800f1296b1979f1b34dcc5d56a376 (commit)
from df15e8f84d108f8e9df1408155b0f9ccc44da3fe (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit 97f1514ce95800f1296b1979f1b34dcc5d56a376
Author: Günther Deschner <gd at samba.org>
Date: Tue Feb 10 10:59:34 2009 +0100
s3-spoolss: fix memleak in get_remote_printer_publishing_data().
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/libads/ldap_printer.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libads/ldap_printer.c b/source/libads/ldap_printer.c
index eb6e3d3..3ff8846 100644
--- a/source/libads/ldap_printer.c
+++ b/source/libads/ldap_printer.c
@@ -328,11 +328,14 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
if (!W_ERROR_IS_OK(result)) {
DEBUG(3, ("Unable to open printer %s, error is %s.\n",
printername, dos_errstr(result)));
+ SAFE_FREE(printername);
return result;
}
- if ( !(dsdriver_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
+ if ( !(dsdriver_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) ) {
+ SAFE_FREE(printername);
return WERR_NOMEM;
+ }
result = rpccli_spoolss_enumprinterdataex(cli, mem_ctx, &pol, SPOOL_DSDRIVER_KEY, dsdriver_ctr);
@@ -348,8 +351,10 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
}
}
- if ( !(dsspooler_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
+ if ( !(dsspooler_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) ) {
+ SAFE_FREE(printername);
return WERR_NOMEM;
+ }
result = rpccli_spoolss_enumprinterdataex(cli, mem_ctx, &pol, SPOOL_DSSPOOLER_KEY, dsspooler_ctr);
@@ -370,6 +375,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
TALLOC_FREE( dsspooler_ctr );
rpccli_spoolss_close_printer(cli, mem_ctx, &pol);
+ SAFE_FREE(printername);
return result;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list