]> 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:33 +0000 (08:51 -0600)
commitee170ab166e5e1f6f3645a0057657c1fc9760a09
tree7377f7d42138e62708303060613023e52b1bd040
parent9b50bec598c374d7c4d8e3737304b6415b505372
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