mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
gstinfo: Fix leak in generate_backtrace_trace
Spotted by Laurent Pinchart. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/901>
This commit is contained in:
parent
2546cef4be
commit
d4bcff7dab
1 changed files with 2 additions and 1 deletions
|
@ -2942,7 +2942,6 @@ generate_backtrace_trace (void)
|
||||||
char **strings;
|
char **strings;
|
||||||
GString *trace;
|
GString *trace;
|
||||||
|
|
||||||
trace = g_string_new (NULL);
|
|
||||||
nptrs = backtrace (buffer, BT_BUF_SIZE);
|
nptrs = backtrace (buffer, BT_BUF_SIZE);
|
||||||
|
|
||||||
strings = backtrace_symbols (buffer, nptrs);
|
strings = backtrace_symbols (buffer, nptrs);
|
||||||
|
@ -2950,6 +2949,8 @@ generate_backtrace_trace (void)
|
||||||
if (!strings)
|
if (!strings)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
trace = g_string_new (NULL);
|
||||||
|
|
||||||
for (j = 0; j < nptrs; j++)
|
for (j = 0; j < nptrs; j++)
|
||||||
g_string_append_printf (trace, "%s\n", strings[j]);
|
g_string_append_printf (trace, "%s\n", strings[j]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue