Message ID | 20250522125521.6465-4-laurent.pinchart@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
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@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@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 }; > } >
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 }; }
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@ideasonboard.com> --- src/gstreamer/gstlibcamerasrc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)