From 3533520655ef095ef009af9b6b27a20b45fd13ee Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Wed, 24 Jun 2015 01:23:35 +0200 Subject: [PATCH] avs: Fix file handle leak --- input/avs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/avs.c b/input/avs.c index d693dd46..3e4c8e57 100644 --- a/input/avs.c +++ b/input/avs.c @@ -175,8 +175,9 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c FILE *fh = x264_fopen( psz_filename, "r" ); if( !fh ) return -1; - FAIL_IF_ERROR( !x264_is_regular_file( fh ), "AVS input is incompatible with non-regular file `%s'\n", psz_filename ); + int b_regular = x264_is_regular_file( fh ); fclose( fh ); + FAIL_IF_ERROR( !b_regular, "AVS input is incompatible with non-regular file `%s'\n", psz_filename ); avs_hnd_t *h = malloc( sizeof(avs_hnd_t) ); if( !h ) -- 2.39.5