{
GstInputSelector *sel;
GstPad *otherpad;
- GstIterator *it;
+ GstIterator *it = NULL;
GValue val = { 0, };
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
return NULL;
otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
- g_value_init (&val, GST_TYPE_PAD);
- g_value_set_object (&val, otherpad);
- it = gst_iterator_new_single (GST_TYPE_PAD, &val);
- g_value_unset (&val);
-
- if (otherpad)
+ if (otherpad) {
+ g_value_init (&val, GST_TYPE_PAD);
+ g_value_set_object (&val, otherpad);
+ it = gst_iterator_new_single (GST_TYPE_PAD, &val);
+ g_value_unset (&val);
gst_object_unref (otherpad);
+ }
gst_object_unref (sel);
return it;