mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Shiz <hi@shiz.me>
To: musl@lists.openwall.com
Subject: Re: gethostbyname2.c / 6476b8135760659b25c93ff9308425ca98a9e777 breaking asterisk 13 compatibility
Date: Thu, 24 Aug 2017 14:47:04 +0200	[thread overview]
Message-ID: <B1724849-3441-4BF2-9671-87B694D541BD@shiz.me> (raw)
In-Reply-To: <1503574813.12219.17.camel@wwcom.ch>

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]


>> 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

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-08-24 12:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 11:39 Pirmin Walthert
2017-08-24 11:40 ` Pirmin Walthert
2017-08-24 12:47   ` Shiz [this message]
2017-08-24 13:02     ` Pirmin Walthert
2017-08-24 12:58 ` Timo Teras
2017-08-24 13:09   ` Pirmin Walthert
2017-08-24 16:17 ` Rich Felker
2017-08-24 16:24   ` Pirmin Walthert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B1724849-3441-4BF2-9671-87B694D541BD@shiz.me \
    --to=hi@shiz.me \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).