Bug 30653 - Memory leak in translate_name
Summary: Memory leak in translate_name
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.1.1
: P3 trivial
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-31 13:05 UTC by huiwu
Modified: 2007-01-31 13:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.