aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.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/match.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/match.c')
-rw-r--r--gcc/fortran/match.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d46a495..06585af 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -5325,6 +5325,7 @@ gfc_match_select_type (void)
char name[GFC_MAX_SYMBOL_LEN];
bool class_array;
gfc_symbol *sym;
+ gfc_namespace *parent_ns;
m = gfc_match_label ();
if (m == MATCH_ERROR)
@@ -5404,7 +5405,9 @@ gfc_match_select_type (void)
return MATCH_YES;
cleanup:
- gfc_current_ns = gfc_current_ns->parent;
+ parent_ns = gfc_current_ns->parent;
+ gfc_free_namespace (gfc_current_ns);
+ gfc_current_ns = parent_ns;
return m;
}