rtsp-media-factory: Don't cache any media if NULL was returned as key

The docs already mentioned this, but we actually stored it in the hash
table with key==NULL and leaked its reference forever.
This commit is contained in:
Sebastian Dröge 2017-09-25 19:40:17 +03:00
parent f1088f368f
commit c04e3b07dd

View file

@ -1216,7 +1216,7 @@ gst_rtsp_media_factory_construct (GstRTSPMediaFactory * factory,
NULL);
/* check if we can cache this media */
if (gst_rtsp_media_is_shared (media)) {
if (gst_rtsp_media_is_shared (media) && key) {
/* insert in the hashtable, takes ownership of the key */
g_object_ref (media);
g_hash_table_insert (priv->medias, key, media);