TT#108003 fix possible deadlock

Change-Id: I604bd76248aa0bc33589ee379a99b6f82c840662
pull/1194/head
Richard Fuchs 4 years ago
parent 1219b2fdbd
commit 21d1057f68

@ -580,7 +580,7 @@ int t38_gateway_input_udptl(struct t38_gateway *tg, const str *buf) {
// get seq num // get seq num
uint16_t seq; uint16_t seq;
if (str_shift_ret(&s, 2, &piece)) if (str_shift_ret(&s, 2, &piece))
goto err; goto err_nolock;
seq = ntohs(*((uint16_t *) piece.s)); seq = ntohs(*((uint16_t *) piece.s));
err = "Invalid primary UDPTL packet"; err = "Invalid primary UDPTL packet";
@ -593,7 +593,7 @@ int t38_gateway_input_udptl(struct t38_gateway *tg, const str *buf) {
err = "Error correction mode byte missing"; err = "Error correction mode byte missing";
if (str_shift_ret(&s, 1, &piece)) if (str_shift_ret(&s, 1, &piece))
goto err; goto err_nolock;
char fec = piece.s[0]; char fec = piece.s[0];
mutex_lock(&tg->lock); mutex_lock(&tg->lock);
@ -756,6 +756,8 @@ out:
return 0; return 0;
err: err:
mutex_unlock(&tg->lock);
err_nolock:
if (err) if (err)
ilog(LOG_ERR | LOG_FLAG_LIMIT, "Failed to process UDPTL/T.38/IFP packet: %s", err); ilog(LOG_ERR | LOG_FLAG_LIMIT, "Failed to process UDPTL/T.38/IFP packet: %s", err);
if (up) if (up)

Loading…
Cancel
Save