udpsrc: Plug leaks of saddr in error cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/977>
This commit is contained in:
Jan Alexander Steffens (heftig) 2021-05-07 11:16:47 +02:00 committed by GStreamer Marge Bot
parent e425bcada5
commit 0ff50d6723

View file

@ -1213,6 +1213,7 @@ receive_error:
{ {
gst_buffer_unmap (outbuf, &info); gst_buffer_unmap (outbuf, &info);
gst_memory_unmap (udpsrc->extra_mem, &extra_info); gst_memory_unmap (udpsrc->extra_mem, &extra_info);
g_clear_object (&saddr);
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) || if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) ||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_clear_error (&err); g_clear_error (&err);
@ -1226,6 +1227,7 @@ receive_error:
} }
skip_error: skip_error:
{ {
g_clear_object (&saddr);
GST_ELEMENT_ERROR (udpsrc, STREAM, DECODE, (NULL), GST_ELEMENT_ERROR (udpsrc, STREAM, DECODE, (NULL),
("UDP buffer to small to skip header")); ("UDP buffer to small to skip header"));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;