Skip to content

Commit 4ab4b29

Browse files
committed
exm2eml: add error handling for message_content_init call
Fixes: gromox-2.2-85-gaea1d4854
1 parent f66ec43 commit 4ab4b29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/exm2eml.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ int main(int argc, char **argv) try
178178
msg_id = strtoull(sep + 1, nullptr, 0);
179179
uint32_t inst_id = 0;
180180
ctnt = message_content_init();
181+
if (ctnt == nullptr)
182+
throw std::bad_alloc();
181183
if (!exmdb_client_remote::load_message_instance(g_storedir,
182184
nullptr, CP_UTF8, false, rop_util_make_eid_ex(1, folder_id),
183185
rop_util_make_eid_ex(1, msg_id), &inst_id)) {
@@ -199,7 +201,7 @@ int main(int argc, char **argv) try
199201
}
200202
if (ctnt == nullptr) {
201203
fprintf(stderr, "A message by the id %llxh was not found\n",
202-
static_cast<unsigned long long>(msg_id));
204+
static_cast<unsigned long long>(msg_id));
203205
return EXIT_FAILURE;
204206
}
205207
}

0 commit comments

Comments
 (0)