From d4bcff7dabf15e66e025b52b0337cb0c4a7985e1 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 24 Sep 2021 08:19:51 -0400 Subject: [PATCH] gstinfo: Fix leak in generate_backtrace_trace Spotted by Laurent Pinchart. Part-of: --- subprojects/gstreamer/gst/gstinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/gstreamer/gst/gstinfo.c b/subprojects/gstreamer/gst/gstinfo.c index d11c558be6..bb5979c34e 100644 --- a/subprojects/gstreamer/gst/gstinfo.c +++ b/subprojects/gstreamer/gst/gstinfo.c @@ -2942,7 +2942,6 @@ generate_backtrace_trace (void) char **strings; GString *trace; - trace = g_string_new (NULL); nptrs = backtrace (buffer, BT_BUF_SIZE); strings = backtrace_symbols (buffer, nptrs); @@ -2950,6 +2949,8 @@ generate_backtrace_trace (void) if (!strings) return NULL; + trace = g_string_new (NULL); + for (j = 0; j < nptrs; j++) g_string_append_printf (trace, "%s\n", strings[j]);