Cleanup: avoid memory leak

Coverity CID 207773

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-12-28 08:35:23 -08:00
parent 898ce52455
commit fc20155d52

View File

@ -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;
}