Skip to content

Commit ea0cce4

Browse files
committed
Return the correct error code
Return the error code DC_STATUS_NOMEMORY when running out of memory instead of DC_STATUS_SUCCESS.
1 parent 4d2b3ba commit ea0cce4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cressi_goa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ cressi_goa_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, v
414414
logbook = dc_buffer_new(4096);
415415
if (logbook == NULL) {
416416
ERROR (abstract->context, "Failed to allocate memory.");
417+
status = DC_STATUS_NOMEMORY;
417418
goto error_exit;
418419
}
419420

@@ -455,6 +456,7 @@ cressi_goa_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, v
455456
dive = dc_buffer_new(4096);
456457
if (dive == NULL) {
457458
ERROR (abstract->context, "Failed to allocate memory.");
459+
status = DC_STATUS_NOMEMORY;
458460
goto error_free_logbook;
459461
}
460462

0 commit comments

Comments
 (0)