mirror of https://github.com/ecmwf/eccodes.git
Error handling: Memory leak
This commit is contained in:
parent
72f917077d
commit
87c768ff18
|
@ -366,8 +366,10 @@ int grib_nearest_find_generic(
|
|||
return GRIB_OUT_OF_MEMORY;
|
||||
|
||||
iter = grib_iterator_new(h, 0, &ret);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
free(neighbours);
|
||||
return ret;
|
||||
}
|
||||
/* First pass: collect all latitudes and longitudes */
|
||||
while (grib_iterator_next(iter, &lat, &lon, &the_value)) {
|
||||
++the_index;
|
||||
|
|
Loading…
Reference in New Issue