Bug 30653

Summary: Memory leak in translate_name
Product: gcc Reporter: huiwu <wuhui1973>
Component: otherAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: trivial CC: gcc-bugs
Priority: P3    
Version: 4.1.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description huiwu 2007-01-31 13:05:59 UTC
In function translate_name, in file gcc-4.1.1\gcc\prefix.c, at line 204, variable key is allocated a block of memory, however this memory is never returned to the system, which will casue memory leak. Suggest add "free(key);" around line 227 just inside the for loop from line 193.
Comment 1 Richard Biener 2007-01-31 13:13:03 UTC
It's using alloca which returns memory that is automatically freed when the
calling function returns.