From 84f3818bb84e2f51e62f9ac596d1826439fe9a1f Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Tue, 15 Dec 2020 08:32:00 +0100 Subject: [PATCH] stest_performance: add some error checking Change-Id: I95f8ec6be9597d05d5ebb3a847f241d5cb9e8dc9 --- src/stest_performance.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stest_performance.cpp b/src/stest_performance.cpp index bda50f8..410cbc7 100644 --- a/src/stest_performance.cpp +++ b/src/stest_performance.cpp @@ -213,8 +213,12 @@ void run_fb(const char *conf_file, const std::string &serialized, bool verify, s StorageBackendSerialized storage; if (serialized.empty()) { - size_t size; + size_t size = 0; auto buff = serializer.serialize(conf_file, size); + if (!buff) { + std::cerr << "Serialization failed" << std::endl; + return; + } storage.initFromData(buff, size, verify); } else { storage.init(serialized.c_str(), verify); -- 2.7.4