aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-11-24 12:42:24 +0100
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-11-24 12:42:24 +0100
commit5446094655df842abb4ababac39f34c6342e8da3 (patch)
treecd1bbb46f4f66e94a76e015efb891ec981b108db /gdb/source.c
parentf5e0fe29ee3b3b9a27a68aacdb6950fa22372099 (diff)
downloadbinutils-5446094655df842abb4ababac39f34c6342e8da3.zip
binutils-5446094655df842abb4ababac39f34c6342e8da3.tar.gz
binutils-5446094655df842abb4ababac39f34c6342e8da3.tar.bz2
Re-fix leak in source.c (open_source_file).
Leak fixed in '8e6a5953e1d Fix 4K leak in open_source_file' has been partially undone by '2179fbc36d23 Return scoped_fd from open_source_file'. Re-add the transfer of current s->fullname to the unique_xmalloc_ptr fullname given to find_and_open_source.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/source.c b/gdb/source.c
index b38eed5..e295fbf 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1068,7 +1068,7 @@ open_source_file (struct symtab *s)
if (!s)
return scoped_fd (-1);
- gdb::unique_xmalloc_ptr<char> fullname;
+ gdb::unique_xmalloc_ptr<char> fullname (s->fullname);
s->fullname = NULL;
scoped_fd fd = find_and_open_source (s->filename, SYMTAB_DIRNAME (s),
&fullname);