The branch, v3-2-test has been updated
       via  b698559694d3f1799dec290433f75fbb73aceb32 (commit)
      from  197b4c42bbf53347f4953e39099192693d709a7d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit b698559694d3f1799dec290433f75fbb73aceb32
Author: Günther Deschner <g...@samba.org>
Date:   Tue Feb 10 10:59:34 2009 +0100

    s3-spoolss: fix memleak in get_remote_printer_publishing_data().
    
    Guenther
    (cherry picked from commit 97f1514ce95800f1296b1979f1b34dcc5d56a376)

-----------------------------------------------------------------------

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 05fbc07..235fc04 100644
--- a/source/libads/ldap_printer.c
+++ b/source/libads/ldap_printer.c
@@ -301,11 +301,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);
 
@@ -321,8 +324,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);
 
@@ -343,6 +348,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

Reply via email to