resindvd, uvch264src, dx9screencapsrc: fix clock ref leaks in error paths

https://bugzilla.gnome.org/show_bug.cgi?id=776376
diff --git a/ext/resindvd/rsninputselector.c b/ext/resindvd/rsninputselector.c
index 6783116..4542ede 100644
--- a/ext/resindvd/rsninputselector.c
+++ b/ext/resindvd/rsninputselector.c
@@ -695,6 +695,7 @@
           cur_running_time -= base_time;
         else
           cur_running_time = 0;
+        gst_object_unref (clock);
       }
     } else {
       GstSegment *active_seg;
@@ -814,6 +815,7 @@
         cur_running_time -= base_time;
       else
         cur_running_time = 0;
+      gst_object_unref (clock);
     }
   } else {
     GstPad *active_sinkpad;
diff --git a/sys/uvch264/gstuvch264_src.c b/sys/uvch264/gstuvch264_src.c
index ed9dbe9..11b4a62 100644
--- a/sys/uvch264/gstuvch264_src.c
+++ b/sys/uvch264/gstuvch264_src.c
@@ -2544,6 +2544,8 @@
   gst_bin_remove (GST_BIN (self), self->v4l2_src);
 
 error:
+  if (v4l2_clock)
+    gst_object_unref (v4l2_clock);
   if (self->v4l2_src)
     gst_object_unref (self->v4l2_src);
   self->v4l2_src = NULL;
diff --git a/sys/winscreencap/gstdx9screencapsrc.c b/sys/winscreencap/gstdx9screencapsrc.c
index e7ee429..4768c95 100644
--- a/sys/winscreencap/gstdx9screencapsrc.c
+++ b/sys/winscreencap/gstdx9screencapsrc.c
@@ -516,6 +516,7 @@
     if (ret == GST_CLOCK_UNSCHEDULED) {
       /* Got woken up by the unlock function */
       GST_OBJECT_UNLOCK (src);
+      gst_object_unref (clock);
       return GST_FLOW_FLUSHING;
     }
     GST_OBJECT_UNLOCK (src);
@@ -554,6 +555,8 @@
       IDirect3DDevice9_GetFrontBufferData (src->d3d9_device, 0, src->surface);
   if (FAILED (hres)) {
     GST_DEBUG_OBJECT (src, "DirectX::GetBackBuffer failed.");
+    if (clock != NULL)
+      gst_object_unref (clock);
     return GST_FLOW_ERROR;
   }
 
@@ -591,6 +594,8 @@
       D3DLOCK_NO_DIRTY_UPDATE | D3DLOCK_NOSYSLOCK | D3DLOCK_READONLY);
   if (FAILED (hres)) {
     GST_DEBUG_OBJECT (src, "DirectX::LockRect failed.");
+    if (clock != NULL)
+      gst_object_unref (clock);
     return GST_FLOW_ERROR;
   }