[PATCH 04/14] Cleanup: avoid memory leak
Dirk Hohndel
dirk at hohndel.org
Thu Dec 28 16:35:32 PST 2017
Coverity CID 207773
Signed-off-by: Dirk Hohndel <dirk at hohndel.org>
---
src/reefnet_sensusultra.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/reefnet_sensusultra.c b/src/reefnet_sensusultra.c
index fd3d39961f46..a6aef5aca4db 100644
--- a/src/reefnet_sensusultra.c
+++ b/src/reefnet_sensusultra.c
@@ -716,6 +716,7 @@ reefnet_sensusultra_device_foreach (dc_device_t *abstract, dc_dive_callback_t ca
// Prepend the packet to the buffer.
if (!dc_buffer_prepend (buffer, packet + 2, SZ_PACKET)) {
+ dc_buffer_free (buffer);
ERROR (abstract->context, "Insufficient buffer space available.");
return DC_STATUS_NOMEMORY;
}
--
2.15.1
More information about the devel
mailing list