summaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorBob Rossi <bob@brasko.net>2004-07-08 11:18:27 +0000
committerBob Rossi <bob@brasko.net>2004-07-08 11:18:27 +0000
commit1ece78f05dafa3f623f4b585652166bb28449995 (patch)
treea3508f9891374c7fce111106c13bb5db8bb33c18 /gdb/symtab.c
parent8351ea3f01c3cb249fce85f0e6bfba2121786757 (diff)
downloadgdb-1ece78f05dafa3f623f4b585652166bb28449995.tar.gz
Fix crash in symtab.c.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 8fa7cecb7a5..cd6dd5dd838 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -181,21 +181,25 @@ got_symtab:
if (full_path != NULL)
{
- const char *fp = symtab_to_fullname (s);
- if (FILENAME_CMP (full_path, fp) == 0)
- {
- return s;
- }
+ const char *fp = symtab_to_fullname (s);
+ if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
+ {
+ return s;
+ }
}
if (real_path != NULL)
{
- char *rp = gdb_realpath (symtab_to_fullname (s));
- make_cleanup (xfree, rp);
- if (FILENAME_CMP (real_path, rp) == 0)
- {
- return s;
- }
+ char *fullname = symtab_to_fullname (s);
+ if (fullname != NULL)
+ {
+ char *rp = gdb_realpath (fullname);
+ make_cleanup (xfree, rp);
+ if (FILENAME_CMP (real_path, rp) == 0)
+ {
+ return s;
+ }
+ }
}
}