Commit e22cbff6 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

New null pointer check added to make sure that the Toolbox module no longer...

New null pointer check added to make sure that the Toolbox module no longer data aborts if the application's Messages file cannot be found.

Version 1.43. Tagged as 'Toolbox-1_43'
parent 0cbd2622
/* (1.42)
/* (1.43)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.42
#define Module_MajorVersion_CMHG 1.43
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jun 1998
#define Module_Date_CMHG 16 Jun 1998
#define Module_MajorVersion "1.42"
#define Module_Version 142
#define Module_MajorVersion "1.43"
#define Module_Version 143
#define Module_MinorVersion ""
#define Module_Date "11 Jun 1998"
#define Module_Date "16 Jun 1998"
......@@ -160,7 +160,8 @@ static void task__delete (TaskDescriptor *t)
*/
_swix (MessageTrans_CloseFile, _IN(0), &t->info.messages_fd);
mem_free (t->info.messages_name, "removing messages name");
if (t->info.messages_name != NULL)
mem_free (t->info.messages_name, "removing messages name");
/*
* ... and finally remove the task descriptor
......@@ -300,15 +301,19 @@ static _kernel_oserror *task__load_messages_file (TaskDescriptor *t, _kernel_swi
t->info.messages_name = mem_allocate(string_length(filename)+1, "messages name");
if (t->info.messages_name == NULL)
return make_error(Toolbox_NoMem, 0);
strcpy(t->info.messages_name, filename);
string_copy(t->info.messages_name, filename);
DEBUG debug_output ("start", "T:Trying messages file %s\n", t->info.messages_name);
e = _swix(MessageTrans_OpenFile, _INR(0,2), t->info.messages_fd, t->info.messages_name, 0);
if (e)
if (e) {
DEBUG debug_output("start", "T:error -> %s\n", e->errmess);
mem_free(t->info.messages_name, "removing messages name");
else
t->info.messages_name = NULL;
}
else {
break;
}
}
if (e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment