From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21304 invoked from network); 29 Jul 2022 18:53:54 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 29 Jul 2022 18:53:54 -0000 Received: (qmail 32082 invoked by uid 550); 29 Jul 2022 18:53:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32045 invoked from network); 29 Jul 2022 18:53:50 -0000 X-Virus-Scanned: SPAM Filter at disroot.org Date: Sat, 30 Jul 2022 00:53:57 +0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1659120817; bh=5316p4I6v/OuZevcyeajg5sz7/TKgKk/biidPWF3A3k=; h=Date:From:To:Subject:References:In-Reply-To; b=jCXTOSuhOVaITErbpt4JjGs6OmyMGSwgJG4eMVIjgt7Z2LvEjilR3+wN605TRjhtQ Xo/YsYypkPIr0sL48ThYnygE7Cyo41bVHiMCfLjL+KRbxdqpJ4NPOcVDlujduCf7L7 Zt8K6jFSKLCUr5+6bhbYd+nGVtQRTbJZ0g/APhYeX+huvms/bynI/thYUxt5Lf8rsm /2Pur3jtDMQiXisvdN5tiQCaiShnlSeLx944u3fZk1oOPBQMrQDZB/DRSCU0W00CcH f2lWv7rHYq6wDw2xSDf/nxnHTBxoRs5CS0ICZ/as4rgIxNExknoIfJ4sDstXHmIJJS 3FMHdI5NRBGKA== From: NRK To: musl@lists.openwall.com Message-ID: <20220729185357.yifwo5wlkyh33dj3@gen2.localdomain> References: <43e9ad2b-d53c-5fd5-0211-766f946c90f9@landley.net> <48546934-5ccd-0b1e-bf2b-306133101c6b@landley.net> <20220727175859.GC1320090@port70.net> <652507478.86440.1658957388428.JavaMail.zimbra@efficios.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] 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