From ce82829284ea0888008c89ce082c7512c8d663ee Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 23 Feb 2016 22:13:25 +0100 Subject: [PATCH] Fix a memory leak. A new buffer is allocated for each dive, but only the last one is freed. Since the code is already prepared to simply re-use the same buffer, there is no need to allocate those extra buffers. --- src/suunto_eonsteel.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/suunto_eonsteel.c b/src/suunto_eonsteel.c index ec7cfe3..e1c9846 100644 --- a/src/suunto_eonsteel.c +++ b/src/suunto_eonsteel.c @@ -672,9 +672,6 @@ suunto_eonsteel_device_foreach(dc_device_t *abstract, dc_dive_callback_t callbac break; if (!callback(dc_buffer_get_data(file), dc_buffer_get_size(file), NULL, 0, userdata)) skip = 1; - - // We've used up the buffer, so create a new one - file = dc_buffer_new(0); } progress.current++; device_event_emit(abstract, DC_EVENT_PROGRESS, &progress);