Commit 9c9efffd authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

udpsrc: on receive error only unmap and unref buffer if one was alloced and mapped

coverity CID 1139866.
parent 627109ce
......@@ -390,7 +390,7 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
{
GstFlowReturn ret;
GstUDPSrc *udpsrc;
GstBuffer *outbuf;
GstBuffer *outbuf = NULL;
GstMapInfo info;
GSocketAddress *saddr = NULL;
gsize offset;
......@@ -555,8 +555,10 @@ alloc_failed:
}
receive_error:
{
gst_buffer_unmap (outbuf, &info);
gst_buffer_unref (outbuf);
if (outbuf != NULL) {
gst_buffer_unmap (outbuf, &info);
gst_buffer_unref (outbuf);
}
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) ||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment