From bdb1d19a6918b69b22623ca49d44ad9a1b2e8c84 Mon Sep 17 00:00:00 2001 From: Gunnar Kudrjavets Date: Wed, 29 Jun 2016 10:49:25 -0700 Subject: [PATCH] Fix UBSan build break caused by variable not initialized Summary: UBSan is unhappy because `cfd` is not initialized. This breaks UBSan build which in turn breaks MyRocks continuous integration with RocksDB which in turns makes me unhappy :-) Fix this. Test Plan: - `[p]arc diff --preview` + Sandcastle. - Verify that `COMPILE_WITH_UBSAN=1 OPT=-g make J=1 ubsan_check` gets past the break. Reviewers: andrewkr, hermanlee4, sdong Reviewed By: sdong Subscribers: andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D60117 --- db/repair.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/repair.cc b/db/repair.cc index 6e4f0e372..f7010836e 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -449,7 +449,7 @@ class Repairer { AddColumnFamily(props->column_family_name, t->column_family_id); } } - ColumnFamilyData* cfd; + ColumnFamilyData* cfd = nullptr; if (status.ok()) { cfd = vset_.GetColumnFamilySet()->GetColumnFamily(t->column_family_id); if (cfd->GetName() != props->column_family_name) {