Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libcob/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ init_call_stack_list (void)
static struct call_stack_list *
cob_create_call_stack_list (char *name)
{
struct call_stack_list *new_list = cob_malloc (sizeof (struct call_stack_list));
struct call_stack_list *new_list = malloc (sizeof (struct call_stack_list));
memset (new_list, 0, sizeof (struct call_stack_list));
new_list->parent = current_call_stack_list;
new_list->name = cob_malloc (strlen (name) + 1);
new_list->name = malloc (strlen (name) + 1);
strcpy (new_list->name, name);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use strdup directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I updated it.

current_call_stack_list = new_list;
return new_list;
Expand All @@ -319,6 +319,8 @@ cob_cancel_call_stack_list (struct call_stack_list *p)
if (p->sister) {
cob_cancel_call_stack_list (p->sister);
}
free (p->name);
free (p);
}

const char *
Expand Down Expand Up @@ -784,5 +786,6 @@ cob_cancel_all ()
return;
}
cob_cancel_call_stack_list (current_call_stack_list->children);
current_call_stack_list->children = NULL;
return;
}