[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] leak in rl_filename_completion_function
From: |
Chet Ramey |
Subject: |
Re: [PATCH] leak in rl_filename_completion_function |
Date: |
Wed, 5 Jul 2023 15:50:07 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 |
On 7/5/23 3:25 PM, Grisha Levit wrote:
On Wed, May 31, 2023 at 6:23 PM Grisha Levit <grishalevit@gmail.com> wrote:
If rl_filename_rewrite_hook returns a new string for a filename (which
I guess only happens on macOS with bash), it is in most cases not
free-d.
I think this one got dropped.
I think this one might have gotten lost among the other reports, and
looking at it again it occurs to me this might be better solved by
just not allocating a new string in the filename rewrite hook since
rl_filename_completion_function will copy the string anyway.
The rewrite hook is documented to return either its first argument or
a newly-allocated string, so it's up to the rewrite hook to do the
allocation.
--
``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/