Skip to content

Commit 81533e4

Browse files
committed
mtmd: fix danling pointer
1 parent 40e7e6e commit 81533e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/mtmd/mtmd-cli.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ static int eval_message(mtmd_cli_context & ctx, common_chat_msg & msg) {
228228
text.add_special = add_bos;
229229
text.parse_special = true;
230230

231+
std::string formatted_chat;
232+
231233
if (!mtmd_is_deepseekocr(ctx.ctx_vision.get())) {
232-
auto formatted_chat = chat_add_and_format(ctx, msg);
234+
formatted_chat = chat_add_and_format(ctx, msg);
233235
LOG_DBG("formatted_chat.prompt: %s\n", formatted_chat.c_str());
234-
text.text = formatted_chat.c_str();
236+
text.text = formatted_chat.c_str();
235237
}
236238

237239
if (g_is_interrupted) return 0;

0 commit comments

Comments
 (0)