File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -294,11 +294,10 @@ init_call_stack_list (void)
294294static struct call_stack_list *
295295cob_create_call_stack_list (char * name )
296296{
297- struct call_stack_list * new_list = cob_malloc (sizeof (struct call_stack_list ));
297+ 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 = cob_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}
@@ -319,6 +318,8 @@ cob_cancel_call_stack_list (struct call_stack_list *p)
319318 if (p -> sister ) {
320319 cob_cancel_call_stack_list (p -> sister );
321320 }
321+ free (p -> name );
322+ free (p );
322323}
323324
324325const char *
@@ -784,5 +785,6 @@ cob_cancel_all ()
784785 return ;
785786 }
786787 cob_cancel_call_stack_list (current_call_stack_list -> children );
788+ current_call_stack_list -> children = NULL ;
787789 return ;
788790}
You can’t perform that action at this time.
0 commit comments