From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11839 Path: news.gmane.org!.POSTED!not-for-mail From: Pirmin Walthert Newsgroups: gmane.linux.lib.musl.general Subject: Re: gethostbyname2.c / 6476b8135760659b25c93ff9308425ca98a9e777 breaking asterisk 13 compatibility Date: Thu, 24 Aug 2017 15:02:28 +0200 Message-ID: <1503579748.12219.23.camel@wwcom.ch> References: <1503574748.12219.16.camel@wwcom.ch> <1503574813.12219.17.camel@wwcom.ch> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1503579785 6101 195.159.176.226 (24 Aug 2017 13:03:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2017 13:03:05 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11852-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 24 15:02:52 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dkrmP-0000PN-RJ for gllmg-musl@m.gmane.org; Thu, 24 Aug 2017 15:02:37 +0200 Original-Received: (qmail 3153 invoked by uid 550); 24 Aug 2017 13:02:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3135 invoked from network); 24 Aug 2017 13:02:42 -0000 X-Virus-Scanned: by amavisd-new-2.10.1 (20141025) (Debian) at wwcom.ch In-Reply-To: X-Mailer: Evolution 3.24.4 Xref: news.gmane.org gmane.linux.lib.musl.general:11839 Archived-At: Am Donnerstag, den 24.08.2017, 14:47 +0200 schrieb Shiz: > > > Second: I'm currently debugging a strange memory corruption > > > problem > > > and > > > have just had a look at the gethostbyname2.c code: > > > > > > I was wondering: why is it safe to do free(h) on the initial run > > > when > > > *h has not been > > > > > > static struct hostent *h; > > > size_t size = 63; > > > struct hostent *res; > > > int err; > > > do { > > > free(h); > > > > > > Best regards, > > > > > > Pirmin > > h is defined as having static storage, as such its initial > value is NULL. free(NULL) is valid. > > - Shiz You're right, thanks for pointing that out.