Skip to content

Commit

Permalink
fix possible NULL connection
Browse files Browse the repository at this point in the history
  • Loading branch information
slabajo committed Oct 30, 2024
1 parent aca0f6e commit b799164
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,15 @@ kms_rtp_endpoint_get_connection (KmsRtpEndpoint * self, KmsSdpSession * sess,

conn = kms_srtp_session_get_connection (KMS_SRTP_SESSION (sess), handler);

data = sdes_ext_data_new (self, gst_sdp_media_get_media (media));
if (conn == NULL) {
GST_INFO_OBJECT (self, "No connection for media %s", (const gchar*)media->media);
} else {
data = sdes_ext_data_new (self, gst_sdp_media_get_media (media));

g_signal_connect_data (conn, "key-soft-limit",
G_CALLBACK (conn_soft_limit_cb), data,
(GClosureNotify) kms_ref_struct_unref, 0);
g_signal_connect_data (conn, "key-soft-limit",
G_CALLBACK (conn_soft_limit_cb), data,
(GClosureNotify) kms_ref_struct_unref, 0);
}
return conn;
} else {
return kms_rtp_session_get_connection (KMS_RTP_SESSION (sess), handler);
Expand Down

0 comments on commit b799164

Please sign in to comment.