aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.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/primary.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/primary.c')
-rw-r--r--gcc/fortran/primary.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index f362f75..7b64a3c 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1087,6 +1087,7 @@ got_delim:
if (!gfc_check_character_range (c, kind))
{
+ gfc_free_expr (e);
gfc_error ("Character '%s' in string at %C is not representable "
"in character kind %d", gfc_print_wide_char (c), kind);
return MATCH_ERROR;
@@ -1507,8 +1508,9 @@ match_actual_arg (gfc_expr **result)
if (sym->attr.in_common && !sym->attr.proc_pointer)
{
- gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name,
- &sym->declared_at);
+ if (gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name,
+ &sym->declared_at) == FAILURE)
+ return MATCH_ERROR;
break;
}