From 3d59b4e9654f116d4071ab2df23cf8d07c797182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Panzenb=C3=B6ck?= Date: Sat, 11 Jul 2015 18:33:24 +0200 Subject: [PATCH] don't leak file descriptor when error during write --- src/mediaextract_posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mediaextract_posix.c b/src/mediaextract_posix.c index 0a1f169..461b408 100644 --- a/src/mediaextract_posix.c +++ b/src/mediaextract_posix.c @@ -39,6 +39,7 @@ int write_data(const char *filename, const uint8_t *data, size_t length) if (write(outfd, data, length) < 0) { perror(filename); + close(outfd); return 0; } close(outfd);