From ab95e293d2f8c3cab506989f79c2adcba5ecb2b7 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Fri, 1 Sep 2017 14:08:19 -0700 Subject: [PATCH] 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 --- utilities/blob_db/blob_db.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/blob_db/blob_db.cc b/utilities/blob_db/blob_db.cc index 4f95b61f2..947840751 100644 --- a/utilities/blob_db/blob_db.cc +++ b/utilities/blob_db/blob_db.cc @@ -142,16 +142,19 @@ Status BlobDB::Open(const DBOptions& db_options_input, s = bdb->OpenPhase1(); if (!s.ok()) { + delete bdb; return s; } if (no_base_db) { + *blob_db = bdb; return s; } DB* db = nullptr; s = DB::Open(db_options, dbname, column_families, handles, &db); if (!s.ok()) { + delete bdb; return s; }