aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/matchexp.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-10-04 19:32:06 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-10-04 19:32:06 +0200
commitefb63364c51c16d7811aa7d7d173e4c2e1cef665 (patch)
tree263258155d4031ec0367ac574033137c812ebaa4 /gcc/fortran/matchexp.c
parent35057bf7360505c67261d0a8b3650c0fb7ae0637 (diff)
downloadgcc-efb63364c51c16d7811aa7d7d173e4c2e1cef665.zip
gcc-efb63364c51c16d7811aa7d7d173e4c2e1cef665.tar.gz
gcc-efb63364c51c16d7811aa7d7d173e4c2e1cef665.tar.bz2
expr.c (scalarize_intrinsic_call): Plug memory leak.
2012-10-04 Tobias Burnus <burnus@net-b.de> * expr.c (scalarize_intrinsic_call): Plug memory leak. * frontend-passes.c (gcc_assert): Extend assert. * interface.c (gfc_compare_derived_types): Fix comparison. (gfc_check_operator_interface): Move up to make this error message reachable. (get_sym_storage_size): Remove always-true checks. * io.c (format_lex): Add comment. (gfc_free_wait): Free memory. * match.c (gfc_match_select_type): Ditto. * matchexpr.c (match_level_3): Ditto. * primary.c (match_string_constant): Ditto. (match_actual_arg): Check return value. * resolve.c (gfc_resolve_substring_charlen, resolve_typebound_generic_call, resolve_typebound_function, resolve_typebound_subroutine): Free memory. * trans-types.c (gfc_get_derived_type): Remove always-true * check. From-SVN: r192094
Diffstat (limited to 'gcc/fortran/matchexp.c')
-rw-r--r--gcc/fortran/matchexp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c
index 12d5b2d..c1196a8 100644
--- a/gcc/fortran/matchexp.c
+++ b/gcc/fortran/matchexp.c
@@ -543,7 +543,7 @@ match_level_2 (gfc_expr **result)
static match
match_level_3 (gfc_expr **result)
{
- gfc_expr *all, *e, *total;
+ gfc_expr *all, *e, *total = NULL;
locus where;
match m;
@@ -560,12 +560,12 @@ match_level_3 (gfc_expr **result)
m = match_level_2 (&e);
if (m == MATCH_NO)
+ gfc_error (expression_syntax);
+ if (m != MATCH_YES)
{
- gfc_error (expression_syntax);
gfc_free_expr (all);
+ return MATCH_ERROR;
}
- if (m != MATCH_YES)
- return MATCH_ERROR;
total = gfc_concat (all, e);
if (total == NULL)