[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1532-g9996473

Volker Lendecke vl at samba.org
Sat Jan 19 18:34:25 GMT 2008


The branch, v3-2-test has been updated
       via  999647329028147d7c29a3348202641b3e03430e (commit)
       via  373a23d48f2dd24e65dbf814ea58b4add2322128 (commit)
      from  64e54ea8f76fe57193955aabc1459fe635233aca (commit)

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


- Log -----------------------------------------------------------------
commit 999647329028147d7c29a3348202641b3e03430e
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jan 19 19:31:02 2008 +0100

    Use SAFE_FREE instead of free

commit 373a23d48f2dd24e65dbf814ea58b4add2322128
Author: Corinna Vinschen <corinna at vinschen.de>
Date:   Sat Jan 19 15:14:45 2008 +0100

    Tiny memory leak in lib/version.c
    
    Hi,
    
    while implementing the extra_info version stuff, it occured to me that
    samba_version_string() potentially allocates memory which is unused but
    never free'd.
    
    If SAMBA_VERSION_VENDOR_PATCH is defined, a second call to asprintf
    takes place.  The result is stored in tmp_version.  Afterwards,
    samba_version is set to tmp_version without free'ing samba_version
    first.  Looks like a simple free(samba_version) is missing.  Patch
    against 3.2-test below.
    
    Ok, this only happens once over the lifetime of the application, so it's
    no big deal, but I though it doesn't hurt to mention it.
    
    Corinna
    
    	* lib/version.c (samba_version_string): Free samba_version
    	before setting to tmp_version.

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

Summary of changes:
 source/lib/version.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/version.c b/source/lib/version.c
index 204c204..3cae02a 100644
--- a/source/lib/version.c
+++ b/source/lib/version.c
@@ -51,6 +51,8 @@ const char *samba_version_string(void)
 	 */
 	assert(res != -1);
 
+	SAFE_FREE(samba_version);
+
 	samba_version = tmp_version;
 #endif
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list