summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-02 14:44:28 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-02 14:44:28 +0200
commitfbd8b25bfd592f71503d33c2fe39b550263c9185 (patch)
tree671664c3415cb856576b45bf1969577b295839e9
parenta163348561bcdd14feb816e006362639a5862fa9 (diff)
fix: check `builder` variable if not `nullptr` (libbtb example)
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--examples/example_02_libbtb/libbtb.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/example_02_libbtb/libbtb.cc b/examples/example_02_libbtb/libbtb.cc
index f3d45b8..21e3e17 100644
--- a/examples/example_02_libbtb/libbtb.cc
+++ b/examples/example_02_libbtb/libbtb.cc
@@ -1,4 +1,5 @@
#include <BTBKit/JSONManifestBuilder.h>
+#include <cstdlib>
#ifndef _WIN32
static auto kPath = "./posix.json";
@@ -8,5 +9,7 @@ static auto kPath = ".\win64.json";
int main(int argc, char** argv) {
auto builder = new BTB::JSONManifestBuilder();
+ if (!builder) return EXIT_FAILURE;
+
return builder->buildTarget(strlen(kPath), kPath);
}