This patch fixes a scenario in which the ssl_ object was freed.

BUG=webrtc:383141571

Change-Id: I413b028473aff9c3078f9bbab8e1fee718623417
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372340
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43621}
This commit is contained in:
Jonas Oreland 2024-12-20 12:59:40 +01:00 committed by WebRTC LUCI CQ
parent 3afd7d127e
commit 6660e43c30

View File

@ -930,11 +930,13 @@ int OpenSSLStreamAdapter::ContinueSSL() {
} }
} }
if (ssl_ != nullptr) {
struct timeval timeout; struct timeval timeout;
if (DTLSv1_get_timeout(ssl_, &timeout)) { if (DTLSv1_get_timeout(ssl_, &timeout)) {
int delay = timeout.tv_sec * 1000 + timeout.tv_usec / 1000; int delay = timeout.tv_sec * 1000 + timeout.tv_usec / 1000;
SetTimeout(delay); SetTimeout(delay);
} }
}
return 0; return 0;
} }