Fix use after move in SafeSetError
There is not actually any noticeable bug with the code as it was since the RTCError move operators don't reset the type of the moved object. But the clang static analyzer complains about this and it's bad practice. Bug: webrtc:9593 Change-Id: I8c04f193d10733371e0125c5349f9798f916eecf Reviewed-on: https://webrtc-review.googlesource.com/93500 Reviewed-by: Seth Hampson <shampson@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24266}
This commit is contained in:
parent
ee8ad5ff8a
commit
f820a5ea1c
@ -237,10 +237,11 @@ bool SafeSetError(webrtc::RTCErrorType type, webrtc::RTCError* error) {
|
||||
}
|
||||
|
||||
bool SafeSetError(webrtc::RTCError error, webrtc::RTCError* error_out) {
|
||||
bool ok = error.ok();
|
||||
if (error_out) {
|
||||
*error_out = std::move(error);
|
||||
}
|
||||
return error.ok();
|
||||
return ok;
|
||||
}
|
||||
|
||||
std::string GetSignalingStateString(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user