mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
debugqroverlay: fix string leak
g_string_free(.., FALSE) gives us ownership of the string already, no need to duplicate that again with g_strdup(), and doing so will leak the string returned by g_string_free() here. Caught by compiler warnings in newer GLib versions. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4273>
This commit is contained in:
parent
330836db8e
commit
c798f01fae
1 changed files with 3 additions and 2 deletions
|
@ -240,7 +240,7 @@ get_qrcode_content (GstBaseQROverlay * base, GstBuffer * buf,
|
|||
GstVideoInfo * info, gboolean * reuse_prev)
|
||||
{
|
||||
GstDebugQROverlay *filter = GST_DEBUG_QR_OVERLAY (base);
|
||||
GString *res = g_string_new (NULL);
|
||||
GString *res;
|
||||
JsonGenerator *jgen;
|
||||
gchar *framerate_string = g_strdup_printf ("%d/%d", info->fps_n, info->fps_d);
|
||||
|
||||
|
@ -276,9 +276,10 @@ get_qrcode_content (GstBaseQROverlay * base, GstBuffer * buf,
|
|||
jgen = json_generator_new ();
|
||||
json_node_set_object (root, jobj);
|
||||
json_generator_set_root (jgen, root);
|
||||
res = g_string_new (NULL);
|
||||
res = json_generator_to_gstring (jgen, res);
|
||||
g_object_unref (jgen);
|
||||
filter->frame_number++;
|
||||
|
||||
return g_strdup (g_string_free (res, FALSE));
|
||||
return g_string_free (res, FALSE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue