From 160f480a46cbd23873b59ea860b83d47dc98374d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 May 2018 10:19:15 +0300 Subject: v4l2: Free v4l2_device object when closing it The v4l2_device object is allocated dynamically by v4l2_open(), free it in v4l2_close() to make the API symmetrical. Signed-off-by: Laurent Pinchart --- v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/v4l2.c b/v4l2.c index 81ff90e..3baf55b 100644 --- a/v4l2.c +++ b/v4l2.c @@ -329,6 +329,7 @@ void v4l2_close(struct v4l2_device *dev) free(dev->name); close(dev->fd); + free(dev); } /* ----------------------------------------------------------------------------- -- cgit v1.2.3