summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-03-24 08:18:31 -0300
committerJoshua Colp <jcolp@digium.com>2016-03-24 08:18:31 -0300
commita72f3b5bb43e8f8044d2deb77e8a65b0c70ccf14 (patch)
tree044b5bff34ef66fb64bb3137fe287b6b5e79ed03 /tests
parentd7ee89b49950522f78afaca70d194f868f59321c (diff)
tests/test_http_media_cache: Fix file descriptor leak in test.
Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
Diffstat (limited to 'tests')
-rw-r--r--tests/test_http_media_cache.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/test_http_media_cache.c b/tests/test_http_media_cache.c
index 6a57433cb..c08604f1e 100644
--- a/tests/test_http_media_cache.c
+++ b/tests/test_http_media_cache.c
@@ -173,12 +173,10 @@ static int http_callback(struct ast_tcptls_session_instance *ser, const struct a
ast_http_send(ser, method, options.status_code, options.status_text, http_header, NULL, send_file ? fd : 0, 1);
} else {
ast_http_send(ser, method, 304, "Not Modified", http_header, NULL, 0, 1);
- if (send_file) {
- close(fd);
- }
}
if (send_file) {
+ close(fd);
unlink(file_name);
}