aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-05 10:47:48 +0930
committerAlan Modra <amodra@gmail.com>2022-07-09 21:21:48 +0930
commit825816f1cc401b4aa65df9eeaaa39cd657328716 (patch)
tree25cb12773a453ebdb1b22406b415bfbd7ca729bd /gas
parentbdcc1de1ecfabc7d2560aa56cbe5425cb43e9cac (diff)
downloadgdb-825816f1cc401b4aa65df9eeaaa39cd657328716.zip
gdb-825816f1cc401b4aa65df9eeaaa39cd657328716.tar.gz
gdb-825816f1cc401b4aa65df9eeaaa39cd657328716.tar.bz2
read.c s_include: use notes obstack for path
* read.c (s_include): Use notes obstack for path mem.
Diffstat (limited to 'gas')
-rw-r--r--gas/read.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gas/read.c b/gas/read.c
index 6472501..71bb30e 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);
}