diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 68a659deb..cc6a46a55 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1631,7 +1631,7 @@ static const char *kernelize_target(kernelize_state *s, struct packet_stream *st int ret = handler->in->kernel(&reti->decrypt, stream); if (ret) { - ilog(LOG_NOTICE, "SRTP not yet negotiated"); + ilog(LOG_NOTICE, "Decryption SRTP not yet negotiated"); return NULL; } if (!reti->decrypt.cipher || !reti->decrypt.hmac) @@ -1835,7 +1835,14 @@ static const char *kernelize_one(kernelize_state *s, } } - handler->out->kernel(&redi->output.encrypt, sink); + int ret = handler->out->kernel(&redi->output.encrypt, sink); + if (ret) { + if (sink != stream) + mutex_unlock(&sink->lock); + g_free(redi); + ilog(LOG_NOTICE, "Encryption SRTP not yet negotiated"); + return NULL; + } if (sink != stream) mutex_unlock(&sink->lock);