@@ -10127,7 +10127,7 @@ recursive subroutine parse_value(json, unit, str, value)
10127
10127
10128
10128
! pop the next non whitespace character off the file
10129
10129
call json% pop_char(unit, str= str, eof= eof, skip_ws= .true. , &
10130
- skip_comments= json% allow_comments, popped= c)
10130
+ skip_comments= json% allow_comments, popped= c)
10131
10131
10132
10132
if (eof) then
10133
10133
return
@@ -10151,7 +10151,10 @@ recursive subroutine parse_value(json, unit, str, value)
10151
10151
10152
10152
! end an empty array
10153
10153
call json% push_char(c)
10154
- nullify(value)
10154
+ if (associated (value)) then
10155
+ deallocate (value)
10156
+ nullify(value)
10157
+ end if
10155
10158
10156
10159
case (quotation_mark)
10157
10160
@@ -10990,17 +10993,17 @@ recursive subroutine parse_array(json, unit, str, array)
10990
10993
exit
10991
10994
end if
10992
10995
10993
- ! parse value will disassociate an empty array value
10996
+ ! parse value will deallocate an empty array value
10994
10997
if (associated (element)) call json% add(array, element)
10995
10998
10996
10999
! popped the next character
10997
11000
call json% pop_char(unit, str= str, eof= eof, skip_ws= .true. , &
10998
- skip_comments= json% allow_comments, popped= c)
11001
+ skip_comments= json% allow_comments, popped= c)
10999
11002
11000
11003
if (eof) then
11001
11004
! The file ended before array was finished:
11002
11005
call json% throw_exception(' Error in parse_array: ' // &
11003
- ' End of file encountered when parsing an array.' )
11006
+ ' End of file encountered when parsing an array.' )
11004
11007
exit
11005
11008
else if (delimiter == c) then
11006
11009
! parse the next element
0 commit comments