[PATCH] Small regexec.c fixes
Ulrich Drepper
drepper@redhat.com
Mon Dec 29 17:58:00 GMT 2003
-----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-----
More information about the Libc-hacker
mailing list