bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak in function with local array


From: Chet Ramey
Subject: Re: Memory leak in function with local array
Date: Mon, 3 May 2021 09:45:59 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0

On 5/2/21 8:19 AM, Thomas.Grenman@aalto.fi wrote:

Bash Version: 5.1
Patch Level: 4
Release Status: release

Description:
    There seems to be a memory leak in bash when a local array is declared within a function.     I also tested this on "GNU bash, version 5.0.17(1)-release (x86_64-redhat-linux-gnu)" and that one works without any leaks.

Repeat-By:
     #!/bin/bash
     leak() { local arr=("leak"); }
     while :; do leak; done

Thanks for the report. This was fixed back in January as the result of
https://lists.gnu.org/archive/html/bug-bash/2021-01/msg00082.html.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]