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

Joshua Colp asteriskteam at digium.com
Thu Mar 24 06:21:49 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/2454

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/54/2454/1

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: newchange
Gerrit-Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list