Skip to content

Commit

Permalink
The message's name property was not being allocated before we tried t…
Browse files Browse the repository at this point in the history
…o copy bytes into its location.
  • Loading branch information
jeremytregunna committed May 18, 2012
1 parent 0cdfc59 commit eb5edc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wee/message.c
Expand Up @@ -29,7 +29,9 @@
msg_t* msg_new(const char* name, list_t* arguments, msg_t* next)
{
msg_t* msg = (msg_t*)obj_new_with_size(sizeof(*msg));
memcpy(msg->name, name, strlen(name) + 1);
size_t name_len = strlen(name) + 1;
msg->name = malloc(sizeof(name_len));
memcpy(msg->name, name, name_len);
msg->arguments = arguments;
msg->next = next;
return msg;
Expand Down

0 comments on commit eb5edc9

Please sign in to comment.