diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index ced43801f..41ebce9ba 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -392,6 +392,7 @@ void readtec(const char *file, nav_t *nav, int opt) if (!(fp = fopen(efiles[i], "r"))) { trace(2, "ionex file open error %s\n", efiles[i]); + fclose(fp); continue; } else @@ -400,6 +401,7 @@ void readtec(const char *file, nav_t *nav, int opt) if (readionexh(fp, lats, lons, hgts, &rb, &nexp, dcb, rms) <= 0.0) { trace(2, "ionex file format error %s\n", efiles[i]); + fclose(fp); continue; } /* read ionex body */ diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 4000084f6..c6dec6056 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -369,7 +369,7 @@ int readsap(const char *file, gtime_t time, nav_t *nav) pcv = searchpcv(i + 1, "", time, &pcvs); nav->pcvs[i] = pcv ? *pcv : pcv0; } - free(pcvs.pcv); + free(pcv); return 1; }