From: Henrik Gramner Date: Tue, 23 Jun 2015 23:23:35 +0000 (+0200) Subject: avs: Fix file handle leak X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3533520655ef095ef009af9b6b27a20b45fd13ee;p=libx264 avs: Fix file handle leak --- 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 )