+static void slapiConnectionDestroy( Connection **pConn )
+{
+ Connection *conn = *pConn;
+ Operation *op;
+
+ if ( pConn == NULL ) {
+ return;
+ }
+
+ op = (Operation *)conn->c_pending_ops.stqh_first;
+
+ if ( op->o_req_dn.bv_val != NULL ) {
+ slapi_ch_free( (void **)&op->o_req_dn.bv_val );
+ }
+ if ( op->o_req_ndn.bv_val != NULL ) {
+ slapi_ch_free( (void **)&op->o_req_ndn.bv_val );
+ }
+
+ if ( conn->c_sb != NULL ) {
+ ber_sockbuf_free( conn->c_sb );
+ }
+ if ( op != NULL ) {
+ slapi_ch_free( (void **)&op );
+ }
+ slapi_ch_free( (void **)pConn );
+}
+