[Asterisk-code-review] tests/test http media cache: Fix file descriptor leak in test. (asterisk[master])

Anonymous Coward asteriskteam at digium.com
Fri Mar 25 13:38:42 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: tests/test_http_media_cache: Fix file descriptor leak in test.
......................................................................


tests/test_http_media_cache: Fix file descriptor leak in test.

Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
---
M tests/test_http_media_cache.c
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved
  Badalian Vyacheslav: Looks good to me, but someone else must approve



diff --git a/tests/test_http_media_cache.c b/tests/test_http_media_cache.c
index 6a57433..c08604f 100644
--- a/tests/test_http_media_cache.c
+++ b/tests/test_http_media_cache.c
@@ -173,12 +173,10 @@
 		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);
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/2454
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Badalian Vyacheslav <v.badalyan at open-bs.ru>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list