mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Uemis downloader: remove memory leaks
Found more memory leaks Signed-off-by: glerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6504d97ca8
commit
dc02a7aa6d
1 changed files with 3 additions and 4 deletions
|
@ -1030,7 +1030,7 @@ static bool load_uemis_divespot(const char *mountpath, int divespot_id)
|
||||||
bool success = uemis_get_answer(mountpath, "getDivespot", 3, 0, NULL);
|
bool success = uemis_get_answer(mountpath, "getDivespot", 3, 0, NULL);
|
||||||
if (mbuf && success) {
|
if (mbuf && success) {
|
||||||
#if UEMIS_DEBUG & 2
|
#if UEMIS_DEBUG & 2
|
||||||
do_dump_buffer_to_file(mbuf, strdup("Spot"), round);
|
do_dump_buffer_to_file(mbuf, "Spot", round);
|
||||||
#endif
|
#endif
|
||||||
return parse_divespot(mbuf);
|
return parse_divespot(mbuf);
|
||||||
}
|
}
|
||||||
|
@ -1096,7 +1096,6 @@ const char *do_uemis_import(device_data_t *data)
|
||||||
else
|
else
|
||||||
newmax = strdup("0");
|
newmax = strdup("0");
|
||||||
|
|
||||||
// newmax = strdup("240");
|
|
||||||
first = start = atoi(newmax);
|
first = start = atoi(newmax);
|
||||||
|
|
||||||
#if UEMIS_DEBUG & 2
|
#if UEMIS_DEBUG & 2
|
||||||
|
@ -1119,7 +1118,7 @@ const char *do_uemis_import(device_data_t *data)
|
||||||
uemis_mem_status = get_memory(data->download_table);
|
uemis_mem_status = get_memory(data->download_table);
|
||||||
if (success && mbuf && uemis_mem_status != UEMIS_MEM_FULL) {
|
if (success && mbuf && uemis_mem_status != UEMIS_MEM_FULL) {
|
||||||
#if UEMIS_DEBUG % 2
|
#if UEMIS_DEBUG % 2
|
||||||
do_dump_buffer_to_file(mbuf, strdup("Divelogs"), round);
|
do_dump_buffer_to_file(mbuf, "Divelogs", round);
|
||||||
#endif
|
#endif
|
||||||
/* process the buffer we have assembled */
|
/* process the buffer we have assembled */
|
||||||
|
|
||||||
|
@ -1165,7 +1164,7 @@ const char *do_uemis_import(device_data_t *data)
|
||||||
param_buff[2] = dive_to_read_buf;
|
param_buff[2] = dive_to_read_buf;
|
||||||
success = uemis_get_answer(mountpath, "getDive", 3, 0, &result);
|
success = uemis_get_answer(mountpath, "getDive", 3, 0, &result);
|
||||||
#if UEMIS_DEBUG % 2
|
#if UEMIS_DEBUG % 2
|
||||||
do_dump_buffer_to_file(mbuf, strdup("Dive"), round);
|
do_dump_buffer_to_file(mbuf, "Dive", round);
|
||||||
#endif
|
#endif
|
||||||
uemis_mem_status = get_memory(data->download_table);
|
uemis_mem_status = get_memory(data->download_table);
|
||||||
if (uemis_mem_status == UEMIS_MEM_OK || uemis_mem_status == UEMIS_MEM_CRITICAL) {
|
if (uemis_mem_status == UEMIS_MEM_OK || uemis_mem_status == UEMIS_MEM_CRITICAL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue