Fix memory leak on blob db open
Summary: Fixes #2820 Closes https://github.com/facebook/rocksdb/pull/2826 Differential Revision: D5757527 Pulled By: yiwu-arbug fbshipit-source-id: f495b63700495aeaade30a1da5e3675848f3d72f
This commit is contained in:
parent
37ae8cc60f
commit
ab95e293d2
@ -142,16 +142,19 @@ Status BlobDB::Open(const DBOptions& db_options_input,
|
|||||||
|
|
||||||
s = bdb->OpenPhase1();
|
s = bdb->OpenPhase1();
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
|
delete bdb;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (no_base_db) {
|
if (no_base_db) {
|
||||||
|
*blob_db = bdb;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
DB* db = nullptr;
|
DB* db = nullptr;
|
||||||
s = DB::Open(db_options, dbname, column_families, handles, &db);
|
s = DB::Open(db_options, dbname, column_families, handles, &db);
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
|
delete bdb;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user