mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
2cd7b9db25
commit
d0ac061eaf
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue