summaryrefslogtreecommitdiffstats
path: root/core/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-30 09:25:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-30 09:25:21 -0800
commitbc6ec7cccbe01039bb6418f8c8c09b24ed5b9ef3 (patch)
treed0a049d3cc7fb19382fcb94d7c16542631877c56 /core/uemis-downloader.c
parentb03c5a98d4e9a85f26eb2499f992f9a497023578 (diff)
downloadsubsurface-bc6ec7cccbe01039bb6418f8c8c09b24ed5b9ef3.tar.gz
Cleanup: fix memory leak
Oops, I previously fixed only one of two instances. Coverity CID 45078 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/uemis-downloader.c')
-rw-r--r--core/uemis-downloader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c
index 3adb436d1..4ab165406 100644
--- a/core/uemis-downloader.c
+++ b/core/uemis-downloader.c
@@ -584,7 +584,9 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in,
if (ismulti && more_files && tmp[0] == '1') {
int size;
snprintf(fl, 13, "ANS%d.TXT", assembling_mbuf ? filenr - 2 : filenr - 1);
- ans_path = build_filename(build_filename(path, "ANS"), fl);
+ char *intermediate = build_filename(path, "ANS");
+ ans_path = build_filename(intermediate, fl);
+ free(intermediate);
ans_file = subsurface_open(ans_path, O_RDONLY, 0666);
free(ans_path);
size = bytes_available(ans_file);