diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/lib/libsldap/common/ns_reads.c | 6 | ||||
| -rw-r--r-- | usr/src/lib/libsldap/common/ns_sasl.c | 15 | 
2 files changed, 11 insertions, 10 deletions
| diff --git a/usr/src/lib/libsldap/common/ns_reads.c b/usr/src/lib/libsldap/common/ns_reads.c index 103bf9ce2c..cda5b344fe 100644 --- a/usr/src/lib/libsldap/common/ns_reads.c +++ b/usr/src/lib/libsldap/common/ns_reads.c @@ -19,7 +19,7 @@   * CDDL HEADER END   */  /* - * Copyright 2009 Sun Microsystems, Inc.  All rights reserved. + * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.   * Use is subject to license terms.   */ @@ -2960,7 +2960,7 @@ ldap_list(  	/* get the service descriptor - or create a default one */  	rc = __s_api_get_SSD_from_SSDtoUse_service(service, -	    &sdlist, errorp); +	    &sdlist, &error);  	if (rc != NS_LDAP_SUCCESS) {  		delete_search_cookie(cookie);  		*errorp = error; @@ -3563,7 +3563,7 @@ firstEntry(  	/* get the service descriptor - or create a default one */  	rc = __s_api_get_SSD_from_SSDtoUse_service(service, -	    &sdlist, errorp); +	    &sdlist, &error);  	if (rc != NS_LDAP_SUCCESS) {  		*errorp = error;  		return (rc); diff --git a/usr/src/lib/libsldap/common/ns_sasl.c b/usr/src/lib/libsldap/common/ns_sasl.c index 2aa5f0c9f9..0c1c458686 100644 --- a/usr/src/lib/libsldap/common/ns_sasl.c +++ b/usr/src/lib/libsldap/common/ns_sasl.c @@ -19,12 +19,10 @@   * CDDL HEADER END   */  /* - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved. + * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.   * Use is subject to license terms.   */ -#pragma ident	"%Z%%M%	%I%	%E% SMI" -  #include <stdio.h>  #include <stdlib.h>  #include <strings.h> @@ -265,10 +263,13 @@ __s_api_sasl_bind_callback(  		}  		if (ret) { -			interact->result = strdup(ret); -			if (interact->result == NULL) -				return (LDAP_NO_MEMORY); - +			/* +			 * No need to do strdup(ret), the data is always +			 * available in 'defaults' and libldap won't +			 * free it either. strdup(ret) causes memory +			 * leak. +			 */ +			interact->result = ret;  			interact->len = strlen(ret);  		} else {  			interact->result = NULL; | 
