Change-Id: I750bf92f87ed2103f696ba3f8812075744941722
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
if (ret < 0) {
#ifdef CONFIG_MARU
const char _msg[] = "Failed to load disk file from the following path. Check if the file is corrupted or missing.\n\n";
- char* err_msg = NULL;
+ char* err_msg = NULL;
+
err_msg = maru_convert_path((char*)_msg, file);
- start_simple_client(err_msg);
if (err_msg) {
+ start_simple_client(err_msg);
g_free(err_msg);
}
#endif
total_len += (path_len + msg_len);
err_msg = g_malloc0(total_len * sizeof(char));
+ if (!err_msg) {
+ fprintf(stderr, "failed to allocate a buffer for an error massage\n");
+ g_free(current_path);
+ return NULL;
+ }
if (msg) {
snprintf(err_msg, msg_len, "%s", msg);
if (!dos_err_msg) {
fprintf(stderr,
"failed to duplicate an error message from %p\n", err_msg);
- if (current_path) {
- g_free(current_path);
- }
+ g_free(current_path);
g_free(err_msg);
return NULL;
}
g_free(dos_err_msg);
}
#endif
- if (current_path) {
- g_free(current_path);
- }
+ g_free(current_path);
return err_msg;
}