From 87e7d4d7849799e2d05865910c9e13fb6c40d13d Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Sat, 20 Jan 2024 00:54:33 +0700 Subject: [PATCH] Fix bug/warning about temporary object lifetime (#4374) --- nano/node/ipc/flatbuffers_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nano/node/ipc/flatbuffers_handler.cpp b/nano/node/ipc/flatbuffers_handler.cpp index 20a6227fab..6589298d66 100644 --- a/nano/node/ipc/flatbuffers_handler.cpp +++ b/nano/node/ipc/flatbuffers_handler.cpp @@ -64,7 +64,8 @@ std::shared_ptr nano::ipc::flatbuffers_handler::make_flatbu throw nano::error ("Internal IPC error: unable to find api path"); } - char const * include_directories[] = { api_path->string ().c_str (), nullptr }; + const std::string api_path_str = api_path->string (); + char const * include_directories[] = { api_path_str.c_str (), nullptr }; std::string schemafile; if (!flatbuffers::LoadFile ((*api_path / "nanoapi.fbs").string ().c_str (), false, &schemafile)) {