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)
294
294
static struct call_stack_list *
295
295
cob_create_call_stack_list (char * name )
296
296
{
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 ));
298
298
memset (new_list , 0 , sizeof (struct call_stack_list ));
299
299
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 );
302
301
current_call_stack_list = new_list ;
303
302
return new_list ;
304
303
}
@@ -319,6 +318,8 @@ cob_cancel_call_stack_list (struct call_stack_list *p)
319
318
if (p -> sister ) {
320
319
cob_cancel_call_stack_list (p -> sister );
321
320
}
321
+ free (p -> name );
322
+ free (p );
322
323
}
323
324
324
325
const char *
@@ -784,5 +785,6 @@ cob_cancel_all ()
784
785
return ;
785
786
}
786
787
cob_cancel_call_stack_list (current_call_stack_list -> children );
788
+ current_call_stack_list -> children = NULL ;
787
789
return ;
788
790
}
You can’t perform that action at this time.
0 commit comments