summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-10 10:45:55 +0100
committerGünther Deschner <gd@samba.org>2009-02-10 10:54:15 +0100
commit25fc58afcd6051cd387a7114afadab2a85b98cfb (patch)
treed9844820d09122f7c523e8b13758d08093d667bf /source3
parent11f60a62a1d7633e9a8ec62da18ed9ababa694df (diff)
downloadsamba-25fc58afcd6051cd387a7114afadab2a85b98cfb.tar.gz
samba-25fc58afcd6051cd387a7114afadab2a85b98cfb.tar.bz2
samba-25fc58afcd6051cd387a7114afadab2a85b98cfb.zip
s3-spoolss: fix memleak in get_remote_printer_publishing_data().
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/ldap_printer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index c9c43f0e10..1bcb86e996 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -327,11 +327,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, win_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);
@@ -347,8 +350,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);
@@ -369,6 +374,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
TALLOC_FREE( dsspooler_ctr );
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &pol, NULL);
+ SAFE_FREE(printername);
return result;
}