summaryrefslogtreecommitdiffstats
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
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-5446094655df842abb4ababac39f34c6342e8da3.tar.gz
binutils-gdb-5446094655df842abb4ababac39f34c6342e8da3.tar.bz2
binutils-gdb-5446094655df842abb4ababac39f34c6342e8da3.tar.xz
Re-fix leak in source.c (open_source_file).HEADmaster
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.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/source.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 90e8d7a..2515a4d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
12018-11-24 Philippe Waroquiers <philippe.waroquiers@skynet.be>
2
3 * source.c (open_source_file): Leak fixed in '8e6a5953e1d Fix 4K
4 leak in open_source_file' has been partially undone by '2179fbc36d23
5 Return scoped_fd from open_source_file'. Re-add the transfer of
6 current s->fullname to the unique_xmalloc_ptr fullname given
7 to find_and_open_source.
8
12018-11-23 Pedro Alves <palves@redhat.com> 92018-11-23 Pedro Alves <palves@redhat.com>
2 10
3 * gdbthread.h (enum thread_state): Move comments here. 11 * gdbthread.h (enum thread_state): Move comments here.
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)
1068 if (!s) 1068 if (!s)
1069 return scoped_fd (-1); 1069 return scoped_fd (-1);
1070 1070
1071 gdb::unique_xmalloc_ptr<char> fullname; 1071 gdb::unique_xmalloc_ptr<char> fullname (s->fullname);
1072 s->fullname = NULL; 1072 s->fullname = NULL;
1073 scoped_fd fd = find_and_open_source (s->filename, SYMTAB_DIRNAME (s), 1073 scoped_fd fd = find_and_open_source (s->filename, SYMTAB_DIRNAME (s),
1074 &fullname); 1074 &fullname);