/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
return 0;
}
+void
+limits_free_one(
+ struct slap_limits *lm )
+{
+ if ( ( lm->lm_flags & SLAP_LIMITS_MASK ) == SLAP_LIMITS_REGEX )
+ regfree( &lm->lm_regex );
+
+ if ( !BER_BVISNULL( &lm->lm_pat ) )
+ ch_free( lm->lm_pat.bv_val );
+
+ ch_free( lm );
+}
+
void
limits_destroy(
struct slap_limits **lm )
}
for ( i = 0; lm[ i ]; i++ ) {
- if ( (lm[ i ]->lm_flags & SLAP_LIMITS_MASK) == SLAP_LIMITS_REGEX )
- regfree( &lm[ i ]->lm_regex );
-
- if ( !BER_BVISNULL( &lm[ i ]->lm_pat ) )
- ch_free( lm[ i ]->lm_pat.bv_val );
-
- ch_free( lm[ i ] );
+ limits_free_one( lm[ i ] );
}
ch_free( lm );