public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] read.c s_include: use notes obstack for path
@ 2022-07-09 12:35 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-07-09 12:35 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=825816f1cc401b4aa65df9eeaaa39cd657328716
commit 825816f1cc401b4aa65df9eeaaa39cd657328716
Author: Alan Modra <amodra@gmail.com>
Date: Tue Jul 5 10:47:48 2022 +0930
read.c s_include: use notes obstack for path
* 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)
}
demand_empty_rest_of_line ();
- path = XNEWVEC (char, (unsigned long) i
- + include_dir_maxlen + 5 /* slop */ );
+ path = notes_alloc ((size_t) i + include_dir_maxlen + 5);
for (i = 0; i < include_dir_count; i++)
{
@@ -5894,10 +5893,9 @@ s_include (int arg ATTRIBUTE_UNUSED)
}
}
- free (path);
+ notes_free (path);
path = filename;
gotit:
- /* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */
register_dependency (path);
input_scrub_insert_file (path);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-09 12:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09 12:35 [binutils-gdb] read.c s_include: use notes obstack for path Alan Modra
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 read-only IMAP folder(s) and NNTP newsgroup(s).