You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
! If found Section 1, decode elements in Identification Section.
if (isecnum.eq.1) then
iofst = iofst-40 ! reset offset to beginning of section
call gf_unpack1(cgrib, lcgrib, iofst, gfld%idsect,
& gfld%idsectlen, jerr)
if (jerr.ne.0) then
ierr = 15
return
endif
endif
! If found Section 2, Grab local section. Save in case this is
! the latest one before the requested field.
if (isecnum.eq.2) then
iofst = iofst-40 ! reset offset to beginning of section
if (associated(gfld%local)) deallocate(gfld%local)
call gf_unpack2(cgrib, lcgrib, iofst, gfld%locallen,
& gfld%local, jerr)
if (jerr.ne.0) then
ierr = 16
return
endif
endif
The gf_unpack1() function allocates an array in gfld. If the function later exits, this memory is not freed and causes a leak.
The solution is to call gf_free() on gfld before an error exit.
There are a bunch of currently commented-out tests that demonstrate this bug in test_getfield.f90.
The text was updated successfully, but these errors were encountered:
In gf_getfld() we have:
The gf_unpack1() function allocates an array in gfld. If the function later exits, this memory is not freed and causes a leak.
The solution is to call gf_free() on gfld before an error exit.
There are a bunch of currently commented-out tests that demonstrate this bug in test_getfield.f90.
The text was updated successfully, but these errors were encountered: