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: [PATCH] Small regexec.c fixes


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub Jelinek wrote:

> 	* posix/regexec.c (re_copy_regs): Revert comment change.
> 	Avoid memory leak if realloc fails.
> 	(proceed_next_node): Return -2 if re_node_set_insert fails.
> 	Return -2 if push_fail_stack fails.
> 	(push_fail_stack): Change fs->alloc only after successful
> 	realloc.
> 	(pop_fail_stack): Formatting.
> 	(set_regs): If proceed_next_node returns -2, free eps_via_nodes
> 	and fs.
> 	(check_arrival_add_next_nodes): Merge identical statements
> 	from if branches.

I've applied the patch but in general we should avoid adding much code
to free memory in case allocation fails.  Maybe to free some huge blocks
but not more.  If the app runs out of memory it'll very soon terminate.
 No need to bloat the code to help doing this.

- -- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/8Gq92ijCOnn/RHQRAmTxAKCOhphWPBMl5Un4958h3wkO/7/FeACgrHHg
Boh1oDn70uJW50RPVhJD2k4=
=RcIG
-----END PGP SIGNATURE-----


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