diff --git a/src/json_file_module.F90 b/src/json_file_module.F90 index b8f0370ce..53004786c 100644 --- a/src/json_file_module.F90 +++ b/src/json_file_module.F90 @@ -449,7 +449,7 @@ subroutine json_file_check_for_errors(me,status_ok,error_msg) #if defined __GFORTRAN__ character(kind=CK,len=:),allocatable :: tmp !! workaround for gfortran bugs call me%core%check_for_errors(status_ok,tmp) - if (present(error_msg)) error_msg = tmp + if (present(error_msg)) call move_alloc(tmp, error_msg) #else call me%core%check_for_errors(status_ok,error_msg) #endif