[PATCH 3/4] gstreamer: Fix leak of GstQuery in error path
Nicolas Dufresne
nicolas.dufresne at collabora.com
Thu May 22 19:35:39 CEST 2025
Hi,
Le jeudi 22 mai 2025 à 14:55 +0200, Laurent Pinchart a écrit :
> The gst_libcamera_create_video_pool() function leaks a GstQuery instance
> in an error path. Fix it with g_autoptr().
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>
nice catch,
Nicolas
> ---
> src/gstreamer/gstlibcamerasrc.cpp | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> index 71f5700d9de7..380f8368af8b 100644
> --- a/src/gstreamer/gstlibcamerasrc.cpp
> +++ b/src/gstreamer/gstlibcamerasrc.cpp
> @@ -526,7 +526,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self,
> GstVideoInfo *info, GstPad *srcpad,
> GstCaps *caps)
> {
> - GstQuery *query = NULL;
> + g_autoptr(GstQuery) query = NULL;
> const gboolean need_pool = true;
> gboolean has_video_meta = false;
> GstBufferPool *video_pool = NULL;
> @@ -571,7 +571,6 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self,
> }
> }
>
> - gst_query_unref(query);
> return { video_pool, 0 };
> }
>
More information about the libcamera-devel
mailing list