From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: replace alloca with strdup Date: Sun, 22 May 2005 05:15:56 -0400 Message-ID: References: <20050521163028.GM28212@boetes.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1116756004 13180 80.91.229.2 (22 May 2005 10:00:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 May 2005 10:00:04 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 22 12:00:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DZnFA-0005CK-6i for ged-emacs-devel@m.gmane.org; Sun, 22 May 2005 11:59:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DZnIO-0001mc-E0 for ged-emacs-devel@m.gmane.org; Sun, 22 May 2005 06:02:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DZn39-0002nN-Vb for emacs-devel@gnu.org; Sun, 22 May 2005 05:47:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DZn2s-0002iC-VO for emacs-devel@gnu.org; Sun, 22 May 2005 05:47:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DZn27-0001Sv-8K for emacs-devel@gnu.org; Sun, 22 May 2005 05:46:07 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DZmih-000181-2h for emacs-devel@gnu.org; Sun, 22 May 2005 05:26:03 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DZmYu-0005cb-NC; Sun, 22 May 2005 05:15:56 -0400 Original-To: Han Boetes In-reply-to: <20050521163028.GM28212@boetes.org> (message from Han Boetes on Sat, 21 May 2005 18:30:06 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37461 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37461 While looking at some compilerwarnings I found an alloca and an strcpy. What is wrong with that? I don't see any problem in it. And I realized this can also be done as follows: + if ((error_msg = strdup(error_message)) == NULL) + errx(1, "Out of memory."); This creates a memory leak.