1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3-spoolss: fix memleak in get_remote_printer_publishing_data().

Guenther
This commit is contained in:
Günther Deschner 2009-02-10 10:45:55 +01:00
parent 11f60a62a1
commit 25fc58afcd

View File

@ -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;
}