diff --git a/gdb/source.c b/gdb/source.c index ec0ea3b81e3..3cdf0b9ec77 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1070,7 +1070,8 @@ open_source_file (struct symtab *s) if (!s) return -1; - gdb::unique_xmalloc_ptr fullname; + gdb::unique_xmalloc_ptr fullname (s->fullname); + s->fullname = NULL; int fd = find_and_open_source (s->filename, SYMTAB_DIRNAME (s), &fullname); s->fullname = fullname.release (); return fd;