diff options
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index 986aeb5b3..d14e6e7c6 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -534,6 +534,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, snprintf(fl, 13, "ANS%d.TXT", assembling_mbuf ? filenr - 2 : filenr - 1); ans_path = build_filename(build_filename(path, "ANS"), fl); ans_file = subsurface_open(ans_path, O_RDONLY, 0666); + free(ans_path); size = bytes_available(ans_file); if (size > 3) { char *buf; @@ -564,6 +565,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, snprintf(fl, 13, "ANS%d.TXT", filenr - 1); ans_path = build_filename(build_filename(path, "ANS"), fl); ans_file = subsurface_open(ans_path, O_RDONLY, 0666); + free(ans_path); size = bytes_available(ans_file); if (size > 3) { int r; @@ -578,12 +580,11 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, buffer_add(&mbuf, &mbuf_size, buf); show_progress(buf, what); #if UEMIS_DEBUG & 8 - fprintf(debugfile, "::r %s \"%s\"\n", ans_path, buf); + fprintf(debugfile, "::r %s \"%s\"\n", fl, buf); #endif } size -= 3; close(ans_file); - free(ans_path); } else { ismulti = false; } |