public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: Re: [PATCH] Small regexec.c fixes
Date: Mon, 29 Dec 2003 17:58:00 -0000	[thread overview]
Message-ID: <3FF06ABD.6090300@redhat.com> (raw)
In-Reply-To: <20031229134122.GO12344@sunsite.ms.mff.cuni.cz>

-----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-----

  reply	other threads:[~2003-12-29 17:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29 15:47 Jakub Jelinek
2003-12-29 17:58 ` Ulrich Drepper [this message]
2003-12-29 21:10   ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FF06ABD.6090300@redhat.com \
    --to=drepper@redhat.com \
    --cc=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).