From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: execl, execlp memory leak Date: Wed, 25 Feb 2004 08:40:31 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87d684hzj4.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1077663071 26623 80.91.224.253 (24 Feb 2004 22:51:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2004 22:51:11 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 24 23:51:06 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvlOM-0006Qu-00 for ; Tue, 24 Feb 2004 23:51:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvlNa-00076x-4z for guile-devel@m.gmane.org; Tue, 24 Feb 2004 17:50:18 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AvlKx-0005PN-38 for guile-devel@gnu.org; Tue, 24 Feb 2004 17:47:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AvlJp-0004bT-F6 for guile-devel@gnu.org; Tue, 24 Feb 2004 17:46:56 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvlEe-0002hH-QS for guile-devel@gnu.org; Tue, 24 Feb 2004 17:41:05 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1OMexLE025356 for ; Wed, 25 Feb 2004 09:40:59 +1100 Original-Received: from localhost (ppp114.dyn11.pacific.net.au [61.8.11.114]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1OMej0H030515 for ; Wed, 25 Feb 2004 09:40:54 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1AvlEA-0000M0-00; Wed, 25 Feb 2004 08:40:34 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3448 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3448 --=-=-= * posix.c (scm_execl, scm_execlp): Avoid memory leak under error throw. This can be seen with for instance (while #t (false-if-exception (execl "nosuchprog"))) This would be for the 1.6 branch too. --=-=-= Content-Disposition: inline; filename=posix.c.exec-leak.diff --- posix.c.~1.125.~ 2004-02-22 07:54:37.000000000 +1000 +++ posix.c 2004-02-24 19:37:00.000000000 +1000 @@ -909,9 +909,13 @@ #define FUNC_NAME s_scm_execl { char **execargv; + int save_errno; SCM_VALIDATE_STRING (1, filename); execargv = allocate_string_pointers (args); execv (SCM_STRING_CHARS (filename), execargv); + save_errno = errno; + free (execargv); + errno = save_errno; SCM_SYSERROR; /* not reached. */ return SCM_BOOL_F; @@ -929,9 +933,13 @@ #define FUNC_NAME s_scm_execlp { char **execargv; + int save_errno; SCM_VALIDATE_STRING (1, filename); execargv = allocate_string_pointers (args); execvp (SCM_STRING_CHARS (filename), execargv); + save_errno = errno; + free (execargv); + errno = save_errno; SCM_SYSERROR; /* not reached. */ return SCM_BOOL_F; --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--