Index: ext/ogg/gstoggdemux.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/ogg/gstoggdemux.c,v
retrieving revision 1.113
diff -u -B -p -r1.113 gstoggdemux.c
--- ext/ogg/gstoggdemux.c	10 Nov 2005 18:01:28 -0000	1.113
+++ ext/ogg/gstoggdemux.c	15 Nov 2005 19:00:19 -0000
@@ -1080,9 +1080,11 @@ static void
 gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class)
 {
   /* create the sink pad */
-  ogg->sinkpad =
-      gst_pad_new_from_template (gst_static_pad_template_get
-      (&ogg_demux_sink_template_factory), "sink");
+  GstPadTemplate *template = gst_static_pad_template_get
+    (&ogg_demux_sink_template_factory);
+  ogg->sinkpad = gst_pad_new_from_template (template, "sink");
+  g_object_unref (template);
+  
   gst_pad_set_event_function (ogg->sinkpad, gst_ogg_demux_handle_event);
   gst_pad_set_chain_function (ogg->sinkpad, gst_ogg_demux_chain);
   gst_pad_set_activate_function (ogg->sinkpad, gst_ogg_demux_sink_activate);
@@ -1103,7 +1105,7 @@ gst_ogg_demux_finalize (GObject * object
   GstOggDemux *ogg;
 
   ogg = GST_OGG_DEMUX (object);
-
+  
   g_mutex_free (ogg->chain_lock);
   ogg_sync_clear (&ogg->sync);
 
Index: ext/vorbis/vorbisdec.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/vorbis/vorbisdec.c,v
retrieving revision 1.85
diff -u -B -p -r1.85 vorbisdec.c
--- ext/vorbis/vorbisdec.c	24 Oct 2005 17:40:37 -0000	1.85
+++ ext/vorbis/vorbisdec.c	15 Nov 2005 19:00:19 -0000
@@ -95,11 +95,16 @@ static void
 gst_vorbis_dec_base_init (gpointer g_class)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+  GstPadTemplate *src_template, *sink_template;
 
-  gst_element_class_add_pad_template (element_class,
-      gst_static_pad_template_get (&vorbis_dec_src_factory));
-  gst_element_class_add_pad_template (element_class,
-      gst_static_pad_template_get (&vorbis_dec_sink_factory));
+  src_template = gst_static_pad_template_get (&vorbis_dec_src_factory);
+  gst_element_class_add_pad_template (element_class, src_template);
+  g_object_unref (src_template);
+
+  sink_template = gst_static_pad_template_get (&vorbis_dec_sink_factory);
+  gst_element_class_add_pad_template (element_class, sink_template);
+  g_object_unref (sink_template);
+  
   gst_element_class_set_details (element_class, &vorbis_dec_details);
 }
 
@@ -162,17 +167,21 @@ vorbis_get_query_types (GstPad * pad)
 static void
 gst_vorbis_dec_init (GstVorbisDec * dec, GstVorbisDecClass * g_class)
 {
-  dec->sinkpad =
-      gst_pad_new_from_template (gst_static_pad_template_get
-      (&vorbis_dec_sink_factory), "sink");
+  GstPadTemplate *template;
+
+  template = gst_static_pad_template_get (&vorbis_dec_sink_factory);
+  dec->sinkpad = gst_pad_new_from_template (template, "sink");
+  g_object_unref (template);
+  
   gst_pad_set_event_function (dec->sinkpad, vorbis_dec_sink_event);
   gst_pad_set_chain_function (dec->sinkpad, vorbis_dec_chain);
   gst_pad_set_query_function (dec->sinkpad, vorbis_dec_sink_query);
   gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
 
-  dec->srcpad =
-      gst_pad_new_from_template (gst_static_pad_template_get
-      (&vorbis_dec_src_factory), "src");
+  template = gst_static_pad_template_get (&vorbis_dec_src_factory);
+  dec->srcpad = gst_pad_new_from_template (template, "src");
+  g_object_unref (template);
+  
   gst_pad_set_event_function (dec->srcpad, vorbis_dec_src_event);
   gst_pad_set_query_type_function (dec->srcpad, vorbis_get_query_types);
   gst_pad_set_query_function (dec->srcpad, vorbis_dec_src_query);
