From 9925e251e87608340954dc1691bd12bddeb7481a Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Mon, 2 May 2022 21:22:24 -0600 Subject: [PATCH] Revert free of current_image --- src/motion_loop.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 318f081d..ec71a144 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -115,10 +115,11 @@ static void mlp_ring_destroy(struct ctx_cam *cam) cam->imgs.image_ring = NULL; } - if (cam->current_image != NULL) { - free(cam->current_image); - cam->current_image = NULL; - } + /* + * current_image is an alias from the pointers above which have + * already been freed so we just set it equal to NULL here + */ + cam->current_image = NULL; cam->imgs.ring_size = 0; }