mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
check: Don't leak test string
Turns out the length returned by `__gst_vasprintf()` doesn't include the final `\0`. CID #1455430 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
This commit is contained in:
parent
cab5b22f21
commit
78b0baa7c9
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ test_printf (const char *format, ...)
|
|||
len = __gst_vasprintf (&str, format, varargs);
|
||||
va_end (varargs);
|
||||
|
||||
if (len <= 0)
|
||||
/* The length doesn't include the final `\0`, so if it's >= 0 it's allocated
|
||||
* and non-NULL */
|
||||
if (len < 0)
|
||||
return NULL;
|
||||
|
||||
GST_INFO ("[%s]", str);
|
||||
|
|
Loading…
Reference in a new issue