plug unlikely memleak (coverity)

This commit is contained in:
Howard Chu 2015-01-13 22:43:18 +00:00
parent 74d89e567c
commit 14a3efa48a
2 changed files with 8 additions and 0 deletions

View File

@ -195,6 +195,8 @@ bdb_db_cache(
"bdb_db_cache: db_open(%s) failed: %s (%d)\n",
name->bv_val, db_strerror(rc), rc );
ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex );
db->bdi_db->close( db->bdi_db, 0 );
ch_free( db );
return rc;
}

View File

@ -406,6 +406,7 @@ shm_retry:
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(bdb_db_open) ": %s\n",
cr->msg, 0, 0 );
ch_free( db );
goto fail;
}
@ -419,6 +420,8 @@ shm_retry:
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(bdb_db_open) ": %s\n",
cr->msg, 0, 0 );
db->bdi_db->close( db->bdi_db, 0 );
ch_free( db );
goto fail;
}
}
@ -433,6 +436,8 @@ shm_retry:
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(bdb_db_open) ": %s\n",
cr->msg, 0, 0 );
db->bdi_db->close( db->bdi_db, 0 );
ch_free( db );
goto fail;
}
}
@ -504,6 +509,7 @@ shm_retry:
LDAP_XSTRING(bdb_db_open) ": %s\n",
cr->msg, 0, 0 );
db->bdi_db->close( db->bdi_db, 0 );
ch_free( db );
goto fail;
}