From patchwork Tue May 14 17:45:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 20045 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9BBC9BD78E for ; Tue, 14 May 2024 17:45:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 767BD6347E; Tue, 14 May 2024 19:45:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="gAMOqpOG"; dkim-atps=neutral Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B53F963469 for ; Tue, 14 May 2024 19:45:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1715708747; x=1715967947; bh=IgQ4rxu368NL6s5AEkAi/0jrwR2z5uX4GIH+urt9Y0w=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=gAMOqpOGtAH6dSQ7FpxR5boVZmc+OrgRNU6k+6nzgInfYXa8UjIfPSlaiWFb2duKq 2ujpjp+cwHgcjvZa7bG7NdyuqGp6Yt+0flxCZ3b35ax/EcYzyGFXpDIvFd2hJiSJGB ekhXhK26YKrUH7MC00Ir9vBfgchh3c9l7B+5SYXV6SjRmYotsv0hrTVLjJmNTT75EF 7PauuuoWDF6fZd+4f17t0dnuJtF57MMncuBYC4/+4zYHeR4pOC56rLqREiIjf5T/lI CnYfUnFiexDSeIk0Tj6/Fdyx6eo3WiILyqIfVek4X2iSMuDswg0BQWZrX/RwaEP+2M HgcXccOcspdbw== Date: Tue, 14 May 2024 17:45:39 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v1] gstreamer: Fix string memory leak Message-ID: <20240514174538.195350-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 7264eecf5c3b52db2a90d0817b292d409cddd2b2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The string returned by `gst_video_colorimetry_to_string()` has to be freed, this was missing. Fixes: fc9783acc6083a ("gstreamer: Provide colorimetry <> ColorSpace mappings") Signed-off-by: Barnabás Pőcze Reviewed-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart --- src/gstreamer/gstlibcamera-utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index e163ce41..ec4da435 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -385,7 +385,7 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg if (stream_cfg.colorSpace) { GstVideoColorimetry colorimetry = colorimetry_from_colorspace(stream_cfg.colorSpace.value()); - gchar *colorimetry_str = gst_video_colorimetry_to_string(&colorimetry); + g_autofree gchar *colorimetry_str = gst_video_colorimetry_to_string(&colorimetry); if (colorimetry_str) gst_structure_set(s, "colorimetry", G_TYPE_STRING, colorimetry_str, nullptr);