summaryrefslogtreecommitdiff
path: root/gcc/incpath.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 17:26:37 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 17:26:37 +0000
commit7b6c7f4f40c21711df2307f3da56e11751653237 (patch)
tree9221dcf165ed82113e5ea78e31f03e27b13da4a6 /gcc/incpath.c
parent95b2d078d2e1c0e56ec6156b65bd4d95b9905859 (diff)
downloadgcc-7b6c7f4f40c21711df2307f3da56e11751653237.tar.gz
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR preprocessor/51061 * incpath.c (merge_include_chains): Make sure to not pass null pointers to free_path. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181216 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/incpath.c')
-rw-r--r--gcc/incpath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/incpath.c b/gcc/incpath.c
index aab6e15ab1a..07a765f3fc0 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -362,8 +362,10 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
void
split_quote_chain (void)
{
- free_path (heads[QUOTE], REASON_QUIET);
- free_path (tails[QUOTE], REASON_QUIET);
+ if (heads[QUOTE])
+ free_path (heads[QUOTE], REASON_QUIET);
+ if (tails[QUOTE])
+ free_path (tails[QUOTE], REASON_QUIET);
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
heads[BRACKET] = NULL;