@@ -10895,7 +10895,7 @@ recursive subroutine parse_object(json, unit, str, parent)
10895
10895
skip_comments= json% allow_comments, popped= c)
10896
10896
if (eof) then
10897
10897
call json% throw_exception(' Error in parse_object:' // &
10898
- ' Unexpected end of file while parsing start of object.' )
10898
+ ' Unexpected end of file while parsing start of object.' )
10899
10899
return
10900
10900
else if (end_object == c) then
10901
10901
! end of an empty object
@@ -10922,8 +10922,9 @@ recursive subroutine parse_object(json, unit, str, parent)
10922
10922
call json% pop_char(unit, str= str, eof= eof, skip_ws= .true. , &
10923
10923
skip_comments= json% allow_comments, popped= c)
10924
10924
if (eof) then
10925
+ call json% destroy(pair)
10925
10926
call json% throw_exception(' Error in parse_object:' // &
10926
- ' Unexpected end of file while parsing object member.' )
10927
+ ' Unexpected end of file while parsing object member.' )
10927
10928
return
10928
10929
else if (colon_char == c) then
10929
10930
! parse the value
@@ -10935,6 +10936,7 @@ recursive subroutine parse_object(json, unit, str, parent)
10935
10936
call json% add(parent, pair)
10936
10937
end if
10937
10938
else
10939
+ call json% destroy(pair)
10938
10940
call json% throw_exception(' Error in parse_object:' // &
10939
10941
' Expecting : and then a value: ' // c)
10940
10942
return
@@ -10945,7 +10947,7 @@ recursive subroutine parse_object(json, unit, str, parent)
10945
10947
skip_comments= json% allow_comments, popped= c)
10946
10948
if (eof) then
10947
10949
call json% throw_exception(' Error in parse_object: ' // &
10948
- ' End of file encountered when parsing an object' )
10950
+ ' End of file encountered when parsing an object' )
10949
10951
return
10950
10952
else if (delimiter == c) then
10951
10953
! read the next member
0 commit comments