From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28794 invoked by alias); 17 Feb 2015 10:36:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28749 invoked by uid 89); 17 Feb 2015 10:36:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 17 Feb 2015 10:36:48 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id E8825340749; Tue, 17 Feb 2015 10:36:45 +0000 (UTC) Date: Tue, 17 Feb 2015 10:36:00 -0000 From: Mike Frysinger To: Chen Gang S Cc: Michael Eager , gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: [PATCH] sim: Be sure of calling freeargv() after successfully call buildargv(). Message-ID: <20150217103645.GC544@vapier> Mail-Followup-To: Chen Gang S , Michael Eager , gdb-patches@sourceware.org, binutils@sourceware.org References: <54C8CBC8.90102@sunrus.com.cn> <54C905FE.6020207@eagerm.com> <54C9607B.5060304@sunrus.com.cn> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fig2xvG2VGoz8o/s" Content-Disposition: inline In-Reply-To: <54C9607B.5060304@sunrus.com.cn> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00424.txt.bz2 --Fig2xvG2VGoz8o/s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 698 On 29 Jan 2015 06:19, Chen Gang S wrote: > On 1/28/15 23:53, Michael Eager wrote: > > On 01/28/15 03:45, Chen Gang S wrote: > >> buildargv() and freeargv() are pairs, so need be sure of them always > >> paired to avoid memory leak. > >=20 > > There appear to be other places where buildargv() is not followed by > > freeargv(). See sim/common/run.c. There may be others. >=20 > For me, I intended to skip buildargv() in "sim/common/run.c", because it > may contents read only memory. It is in main(), also main() often uses > exit(), so I skip it, it doesn't matter. i'm not too worried about run.c. in fact, the more it bitrots the better .= .. it=20 gets people to switch to nrun.c :). -mike --Fig2xvG2VGoz8o/s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU4xm9AAoJEEFjO5/oN/WBh5cP+gNVzuOKZ2HtdqWS+5kePMCP zq3XSkw3snHKlQGyN+eWjbgLsmB2vv1C4R5e5PwyaKXxaGPU8sKOtHb8xVc/ZpBc TZKIN8MCZfy+Ge8w7Df4mAYHlls+f8hO1I70oUoUoMkV7HVKudhEktQwZq62uQuf mFUP3pDANtJiOWlWrQNkvgoDig3ACClr8Hz15wKBliWYqF5+2yDEZz58bTmBJi1n Lm334f4UY8bvu77KWe+32qmwZsL0rOuwJxnYtHfBKcEJN11e+GhCf39diKycWrQR E5lp1vmz/OYFFH8BD+VKg7kF6mr+9pY2Ze+bxwxPa97W8mOUdtgT4bsP5ayuQbJF j93OV25quuCsAj0RqE7hFqP97La/ovqI1BsqOmQxgM5fibEyMW/I9+tLbduL/VCr b/tsGhZxg3pFvoexsjUUm5ihFPpkqHxuyRJGeM7hne8WU+V2v13ZN6iGD9cteUzx 3Vueo2W7nqury8Nmd4XBLkfquUd/o9XpF051VUfTH02ldI8RvNLPl6Wz1H2Sotl2 sQQMc6HR/Biy9YYTY5KSWUXLpTwVI3L0lIpmQU3nPJ7wv1/U5co8G4iAXs+cOBw2 BtZNfRQIhh67Qd0pbPUBlil8TZ4ixKhqB5C2QfMax/jIIgdYO8fg3f4XlQ8RKd1Q fwCPgUzZQAAdPg8yFGmC =A1Em -----END PGP SIGNATURE----- --Fig2xvG2VGoz8o/s--