Bug 6740 - ash leaks using local
Summary: ash leaks using local
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.21.x
Hardware: All Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 09:54 UTC by timothy.redaelli
Modified: 2016-11-04 15:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description timothy.redaelli 2013-12-18 09:54:58 UTC
Hi,
the following snippet of code leaks memory:

busybox ash -c 'f() { while :; do local a=1; done } ; f'
Comment 1 Armand C. 2016-10-17 10:26:37 UTC
Hello,

I've encountered this problem in one of my script, causing the system to be out of memory after several weeks. As a workaround I've moved the declaration of the local variable outside of the while loop.

Any chance to get a real fix?
Comment 2 Denys Vlasenko 2016-11-04 15:44:42 UTC
Happens with 1.22.1 (at least), but seems to be already fixed in current git.