This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glob must not call globfree


This was pointed out by Tim Waugh in private mail: wordexp does not always
call globfree after glob.

Andreas.

2002-02-07  Andreas Schwab  <schwab@suse.de>

	* sysdeps/generic/wordexp.c (do_parse_glob): Always call globfree
	after glob.

--- sysdeps/generic/wordexp.c.~1.6.~	Fri Aug 17 09:15:21 2001
+++ sysdeps/generic/wordexp.c	Thu Feb  7 14:12:33 2002
@@ -1,5 +1,5 @@
 /* POSIX.2 wordexp implementation.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Tim Waugh <tim@cyberelk.demon.co.uk>.
 
@@ -395,6 +395,7 @@
     {
       /* We can only run into memory problems.  */
       assert (error == GLOB_NOSPACE);
+      globfree (&globbuf);
       return WRDE_NOSPACE;
     }
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]