Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Clack <[email protected]>
  • Loading branch information
aliddell and nclack authored Jul 30, 2024
1 parent ef515f1 commit 04cbefc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions acquire-driver-common/src/simcams/simulated.camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,7 @@ simcam_set(struct Camera* camera, struct CameraProperties* settings)
};

size_t nbytes = aligned_bytes_of_image(shape);
if (self->im.frame_data)
free(self->im.frame_data);
free(self->im.frame_data);

self->im.frame_data = malloc(nbytes);
if (!self->im.frame_data) {
Expand All @@ -416,8 +415,7 @@ simcam_set(struct Camera* camera, struct CameraProperties* settings)
goto Error;
}

if (self->im.render_data)
free(self->im.render_data);
free(self->im.render_data);

self->im.render_data = malloc(nbytes);
if (!self->im.render_data) {
Expand Down

0 comments on commit 04cbefc

Please sign in to comment.