Skip to content

Commit d93d607

Browse files
committed
ref(call): refactor code to strdup
1 parent be47d1b commit d93d607

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libcob/call.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ cob_create_call_stack_list (char *name)
297297
struct call_stack_list *new_list = malloc (sizeof (struct call_stack_list));
298298
memset (new_list, 0, sizeof (struct call_stack_list));
299299
new_list->parent = current_call_stack_list;
300-
new_list->name = malloc (strlen (name) + 1);
301-
strcpy (new_list->name, name);
300+
new_list->name = strdup (name);
302301
current_call_stack_list = new_list;
303302
return new_list;
304303
}

0 commit comments

Comments
 (0)