From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4724 invoked by alias); 29 Dec 2003 17:58:25 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 4704 invoked from network); 29 Dec 2003 17:58:24 -0000 Received: from unknown (HELO myware.akkadia.org) (24.221.190.179) by sources.redhat.com with SMTP; 29 Dec 2003 17:58:24 -0000 Received: from redhat.com (drepper@myware.akkadia.org [192.168.7.70]) (authenticated bits=0) by myware.akkadia.org (8.12.10/8.12.10) with ESMTP id hBTHuE2K018965; Mon, 29 Dec 2003 09:56:14 -0800 Message-ID: <3FF06ABD.6090300@redhat.com> Date: Mon, 29 Dec 2003 17:58:00 -0000 From: Ulrich Drepper Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20031224 MIME-Version: 1.0 To: Jakub Jelinek CC: Glibc hackers Subject: Re: [PATCH] Small regexec.c fixes References: <20031229134122.GO12344@sunsite.ms.mff.cuni.cz> In-Reply-To: <20031229134122.GO12344@sunsite.ms.mff.cuni.cz> X-Enigmail-Version: 0.82.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-12/txt/msg00096.txt.bz2 -----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-----