summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-09-25 19:40:17 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-09-25 19:41:33 +0300
commitc04e3b07ddef74619367f5c7a2a664c664742096 (patch)
tree01ed1c0af4c33f6764c46985dfc5e59a0586df20
parentf1088f368fd5a3d5b5f16896cea8d2f32a30fe30 (diff)
rtsp-media-factory: Don't cache any media if NULL was returned as keyHEADmaster
The docs already mentioned this, but we actually stored it in the hash table with key==NULL and leaked its reference forever.
-rw-r--r--gst/rtsp-server/rtsp-media-factory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gst/rtsp-server/rtsp-media-factory.c b/gst/rtsp-server/rtsp-media-factory.c
index cecb8a0..fd99298 100644
--- a/gst/rtsp-server/rtsp-media-factory.c
+++ b/gst/rtsp-server/rtsp-media-factory.c
@@ -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);