MozNSS Compat. Layer: Fix memleaks reported by valgrind
Resolves: #1595203
This commit is contained in:
		
							parent
							
								
									44ef9ba558
								
							
						
					
					
						commit
						ff45e6ac8e
					
				| @ -1,7 +1,7 @@ | |||||||
| MozNSS Interception Code | MozNSS Interception Code | ||||||
| 
 | 
 | ||||||
| Author: Matus Honek <mhonek@redhat.com> | Author: Matus Honek <mhonek@redhat.com> | ||||||
| Date: Thu Apr  5 15:47:44 CEST 2018 | Date: Thu Jun 28 14:36:55 CEST 2018 | ||||||
| diff --git a/configure.in b/configure.in
 | diff --git a/configure.in b/configure.in
 | ||||||
| --- a/configure.in
 | --- a/configure.in
 | ||||||
| +++ b/configure.in
 | +++ b/configure.in
 | ||||||
| @ -283,7 +283,7 @@ diff --git a/libraries/libldap/tls_mc.c b/libraries/libldap/tls_mc.c | |||||||
| new file mode 100644 | new file mode 100644 | ||||||
| --- /dev/null
 | --- /dev/null
 | ||||||
| +++ b/libraries/libldap/tls_mc.c
 | +++ b/libraries/libldap/tls_mc.c
 | ||||||
| @@ -0,0 +1,1346 @@
 | @@ -0,0 +1,1351 @@
 | ||||||
| +#include "portable.h"
 | +#include "portable.h"
 | ||||||
| +
 | +
 | ||||||
| +#ifdef HAVE_MOZNSS_COMPATIBILITY
 | +#ifdef HAVE_MOZNSS_COMPATIBILITY
 | ||||||
| @ -1525,6 +1525,7 @@ new file mode 100644 | |||||||
| +		Debug( LDAP_DEBUG_ANY,
 | +		Debug( LDAP_DEBUG_ANY,
 | ||||||
| +		       "tlsmc_convert: WARN: extracted cacerts dir is not present.\n",
 | +		       "tlsmc_convert: WARN: extracted cacerts dir is not present.\n",
 | ||||||
| +		       0, 0, 0 );
 | +		       0, 0, 0 );
 | ||||||
|  | +		if ( *ld_cacertdir ) PR_smprintf_free( *ld_cacertdir );
 | ||||||
| +		*ld_cacertdir = NULL;
 | +		*ld_cacertdir = NULL;
 | ||||||
| +	}
 | +	}
 | ||||||
| +
 | +
 | ||||||
| @ -1536,6 +1537,7 @@ new file mode 100644 | |||||||
| +		Debug( LDAP_DEBUG_ANY,
 | +		Debug( LDAP_DEBUG_ANY,
 | ||||||
| +		       "tlsmc_convert: WARN: extracted cert file is not present.\n",
 | +		       "tlsmc_convert: WARN: extracted cert file is not present.\n",
 | ||||||
| +		       0, 0, 0 );
 | +		       0, 0, 0 );
 | ||||||
|  | +		if ( *ld_cert ) PR_smprintf_free( *ld_cert );
 | ||||||
| +		*ld_cert = NULL;
 | +		*ld_cert = NULL;
 | ||||||
| +	}
 | +	}
 | ||||||
| +
 | +
 | ||||||
| @ -1547,13 +1549,16 @@ new file mode 100644 | |||||||
| +		Debug( LDAP_DEBUG_ANY,
 | +		Debug( LDAP_DEBUG_ANY,
 | ||||||
| +		       "tlsmc_convert: WARN: extracted key file is not present.\n",
 | +		       "tlsmc_convert: WARN: extracted key file is not present.\n",
 | ||||||
| +		       0, 0, 0 );
 | +		       0, 0, 0 );
 | ||||||
|  | +		if ( *ld_key ) PR_smprintf_free( *ld_key );
 | ||||||
| +		*ld_key = NULL;
 | +		*ld_key = NULL;
 | ||||||
| +	}
 | +	}
 | ||||||
| +
 | +
 | ||||||
| +	rv = 1;
 | +	rv = 1;
 | ||||||
| +
 | +
 | ||||||
| +bail:
 | +bail:
 | ||||||
|  | +	if ( checksum ) free( checksum );
 | ||||||
| +	if ( pem_dir ) PR_smprintf_free( pem_dir );
 | +	if ( pem_dir ) PR_smprintf_free( pem_dir );
 | ||||||
|  | +	if ( readme_path ) PR_smprintf_free( readme_path );
 | ||||||
| +	if ( data ) free( data );
 | +	if ( data ) free( data );
 | ||||||
| +	if ( nssdb_prefix ) free( nssdb_prefix );
 | +	if ( nssdb_prefix ) free( nssdb_prefix );
 | ||||||
| +	if ( nssdb_dir_path ) free( nssdb_dir_path );
 | +	if ( nssdb_dir_path ) free( nssdb_dir_path );
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user