From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 60D96384144F; Sat, 9 Jul 2022 12:35:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60D96384144F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] read.c s_include: use notes obstack for path X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: bdcc1de1ecfabc7d2560aa56cbe5425cb43e9cac X-Git-Newrev: 825816f1cc401b4aa65df9eeaaa39cd657328716 Message-Id: <20220709123530.60D96384144F@sourceware.org> Date: Sat, 9 Jul 2022 12:35:30 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2022 12:35:30 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D825816f1cc40= 1b4aa65df9eeaaa39cd657328716 commit 825816f1cc401b4aa65df9eeaaa39cd657328716 Author: Alan Modra Date: Tue Jul 5 10:47:48 2022 +0930 read.c s_include: use notes obstack for path =20 * read.c (s_include): Use notes obstack for path mem. Diff: --- gas/read.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gas/read.c b/gas/read.c index 6472501f5cf..71bb30e4e70 100644 --- a/gas/read.c +++ b/gas/read.c @@ -5879,8 +5879,7 @@ s_include (int arg ATTRIBUTE_UNUSED) } =20 demand_empty_rest_of_line (); - path =3D XNEWVEC (char, (unsigned long) i - + include_dir_maxlen + 5 /* slop */ ); + path =3D notes_alloc ((size_t) i + include_dir_maxlen + 5); =20 for (i =3D 0; i < include_dir_count; i++) { @@ -5894,10 +5893,9 @@ s_include (int arg ATTRIBUTE_UNUSED) } } =20 - free (path); + notes_free (path); path =3D filename; gotit: - /* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */ register_dependency (path); input_scrub_insert_file (path); }