From: Bruno Haible Date: Tue, 21 Oct 2025 07:40:46 +0000 (+0200) Subject: glob: Fix a memory leak. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c58a43aa21cb57e607af46316261fc5181d0b94;p=thirdparty%2Fgnulib.git glob: Fix a memory leak. Found by Coverity. * lib/glob.c (__glob): Add scratch_buffer_free invocation, to match scratch_buffer_init invocation. --- diff --git a/ChangeLog b/ChangeLog index 959300b1ca..ad5c702e99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-10-21 Bruno Haible + + glob: Fix a memory leak. + Found by Coverity. + * lib/glob.c (__glob): Add scratch_buffer_free invocation, to match + scratch_buffer_init invocation. + 2025-10-20 Bruno Haible glob: Add support for Android. diff --git a/lib/glob.c b/lib/glob.c index 48f10ae0e1..dc21014aff 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -872,6 +872,7 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int), { /* We have to regard it as an error if we cannot find the home directory. */ + scratch_buffer_free (&pwtmpbuf); retval = GLOB_NOMATCH; goto out; }