[Asterisk-code-review] streams: Ensure that stream is closed in ast_stream_and_wait on error (asterisk[master])

Peter Fern asteriskteam at digium.com
Tue Nov 22 19:54:16 CST 2022


Attention is currently required from: N A.

Peter Fern has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19574 )

Change subject: streams:  Ensure that stream is closed in ast_stream_and_wait on error
......................................................................


Patch Set 3:

(1 comment)

Patchset:

PS2: 
> > It may also be worth adding a \note in file. […]
Note added to file.h

I checked all call sites and found zero instances where the stream was closed based on the return value, at least not within the same function - I didn't trace out all of the functions where the return value from this function is propagated up the chain, but it would seem unlikely for outer calls to interact with the result in this way, since they have no way of knowing the source of the return value.

So long as callers don't blindly assume that the stream exists after calling this function, there should be no problems, and I found no instances where that was the case. In all cases where the stream was closed, the stopstream function was used, which checks for stream existence before attempting to closestream.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19574
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie46b67314590ad75154595a3d34d461060b2e803
Gerrit-Change-Number: 19574
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Fern <asterisk at obfusc8.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Attention: N A <asterisk at phreaknet.org>
Gerrit-Comment-Date: Wed, 23 Nov 2022 01:54:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <asterisk at phreaknet.org>
Comment-In-Reply-To: Peter Fern <asterisk at obfusc8.org>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221123/b4300491/attachment-0001.html>


More information about the asterisk-code-review mailing list