mailing list of musl libc
 help / color / mirror / code / Atom feed
From: NRK <nrk@disroot.org>
To: musl@lists.openwall.com
Subject: Re: [musl] Re: sysconf(_SC_NPROCESSORS_CONF) broken.
Date: Sat, 30 Jul 2022 00:53:57 +0600	[thread overview]
Message-ID: <20220729185357.yifwo5wlkyh33dj3@gen2.localdomain> (raw)
In-Reply-To: <CAJgzZorKo6gW8QzFSxY9K-sgtrJgfi2Sf9paePW6DnyF9a_VVQ@mail.gmail.com>

On Fri, Jul 29, 2022 at 11:42:19AM -0700, enh wrote:
> done: https://android-review.googlesource.com/c/platform/bionic/+/2168844

	if (getline(&line, &allocated_size, fp) != -1) {
	  cpu_count = GetCpuCountFromString(line);
	  free(line);
	}

Shouldn't the buffer be `free`-ed regardless or weather getline fails or
not? The getline(3) manpage suggests so:

> If *lineptr is set to NULL before the call, then getline() will
> allocate a buffer for storing the line. This buffer should be freed by
> the user program even if getline() failed.

- NRK

  reply	other threads:[~2022-07-29 18:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27  6:28 [musl] " Rob Landley
2022-07-27  6:34 ` [musl] " Rob Landley
2022-07-27 17:58   ` Szabolcs Nagy
2022-07-27 21:29     ` Jonathan Rajotte-Julien
2022-07-28 17:27       ` enh
2022-07-29 18:42         ` enh
2022-07-29 18:53           ` NRK [this message]
2022-07-29 19:39             ` enh
2022-07-27 18:05   ` enh
2022-07-27 23:06     ` [musl] dynamic linker is capturing "reserved" library names erroneously Christopher Sean Morrison
2022-07-28  9:18       ` Szabolcs Nagy
2022-07-28 20:39         ` Christopher Sean Morrison
2022-07-29  0:07           ` Rich Felker
2022-07-29  6:19             ` Christopher Sean Morrison

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=20220729185357.yifwo5wlkyh33dj3@gen2.localdomain \
    --to=nrk@disroot.org \
    --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).