Bug 6740

Summary: ash leaks using local
Product: Busybox Reporter: timothy.redaelli
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs
Priority: P5    
Version: 1.21.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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.