]> git.ipfire.org Git - thirdparty/asterisk.git/commit
streams: Ensure that stream is closed in ast_stream_and_wait on error
authorPeter Fern <asterisk@obfusc8.org>
Tue, 22 Nov 2022 03:37:19 +0000 (14:37 +1100)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 20 Dec 2022 14:51:45 +0000 (08:51 -0600)
commitb1f15569225d959d870fb74098b590a52822b976
treed914ba3c3ae50a74c3d6548849ee778d7aac79ce
parent914c8e28c1bb99b8217f93b51ce8f59870350fb6
streams:  Ensure that stream is closed in ast_stream_and_wait on error

When ast_stream_and_wait returns an error (for example, when attempting
to stream to a channel after hangup) the stream is not closed, and
callers typically do not check the return code. This results in leaking
file descriptors, leading to resource exhaustion.

This change ensures that the stream is closed in case of error.

ASTERISK-30198 #close
Reported-by: Julien Alie
Change-Id: Ie46b67314590ad75154595a3d34d461060b2e803
include/asterisk/file.h
main/file.c