summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-21 20:24:07 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-21 21:13:32 -0700
commitf5726c3d184dce88822fd84dbe994d6fa92c089b (patch)
treeea5f96a9a81a4f07b3425bad134ed9a4959aa10f /uemis-downloader.c
parent004705e33e450c52d6753c55797885aedb6ad769 (diff)
downloadsubsurface-f5726c3d184dce88822fd84dbe994d6fa92c089b.tar.gz
Fix a number of resource leaks
Free memory returned from parse_mkvi_value() Free memory returned from printGPSCoords() Free memory allocated in added_list and removed_list Free memory allocated when adding suffix to dive site name Free memory allocated in cache_deco_state() Free memory allocated in build_filename() Free memory allocated in get_utf8() Free memory allocated in alloc_dive() Free memory allocated as cache but never used Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c5
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;
}