Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220729185357.yifwo5wlkyh33dj3@gen2.localdomain>
Date: Sat, 30 Jul 2022 00:53:57 +0600
From: NRK <nrk@...root.org>
To: musl@...ts.openwall.com
Subject: Re: Re: sysconf(_SC_NPROCESSORS_CONF) broken.

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.