mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
udpsrc: on receive error only unmap and unref buffer if one was alloced and mapped
coverity CID 1139866.
This commit is contained in:
parent
627109ce4d
commit
9c9efffd8c
1 changed files with 5 additions and 3 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue