diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-19 12:35:45 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-19 13:51:03 -0800 |
commit | d0ac061eafaa8e8e471eab4f956c9e2792e94915 (patch) | |
tree | 1e0f5bce33aba8d2fc2036c614a823631b579b91 /core | |
parent | 2cd7b9db25615093a18e8e2335b2dffd4430e471 (diff) | |
download | subsurface-d0ac061eafaa8e8e471eab4f956c9e2792e94915.tar.gz |
Uemis downloader: free ans_path on error
In a few instances, the ans_path was not freed on error. Fix them.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/uemis-downloader.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 6d96975b9..52b4276c2 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -606,10 +606,13 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, #ifdef UEMIS_DEBUG fprintf(debugfile, "open %s failed with errno %d\n", ans_path, errno); #endif + free(ans_path); return false; } - if (read(ans_file, tmp, 100) < 0) + if (read(ans_file, tmp, 100) < 0) { + free(ans_path); return false; + } close(ans_file); #if UEMIS_DEBUG & 8 tmp[100] = '\0'; @@ -670,6 +673,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, #ifdef UEMIS_DEBUG fprintf(debugfile, "open %s failed with errno %d\n", ans_path, errno); #endif + free(ans_path); return false; } free(ans_path); @@ -707,6 +711,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in, #ifdef UEMIS_DEBUG fprintf(debugfile, "open %s failed with errno %d\n", ans_path, errno); #endif + free(ans_path); return false; } |