예제 #1
0
파일: io.c 프로젝트: bagel/openldap-ga
void
ber_free( BerElement *ber, int freebuf )
{
	if( ber == NULL ) {
		LDAP_MEMORY_DEBUG_ASSERT( ber != NULL );
		return;
	}

	if( freebuf ) ber_free_buf( ber );

	ber_memfree_x( (char *) ber, ber->ber_memctx );
}
예제 #2
0
/*
 * Free an array of LDAPControl's
 */
void
ldap_controls_free( LDAPControl **controls )
{
	LDAP_MEMORY_DEBUG_ASSERT( controls != NULL );

	if ( controls != NULL ) {
		int i;

		for( i=0; controls[i] != NULL; i++) {
			ldap_control_free( controls[i] );
		}

		LDAP_FREE( controls );
	}
}
예제 #3
0
/*
 * Free a LDAPControl
 */
void
ldap_control_free( LDAPControl *c )
{
	LDAP_MEMORY_DEBUG_ASSERT( c != NULL );

	if ( c != NULL ) {
		if( c->ldctl_oid != NULL) {
			LDAP_FREE( c->ldctl_oid );
		}

		if( c->ldctl_value.bv_val != NULL ) {
			LDAP_FREE( c->ldctl_value.bv_val );
		}

		LDAP_FREE( c );
	}
}