From: Anton Mitrofanov Date: Fri, 24 Jul 2015 21:20:47 +0000 (+0300) Subject: mp4: Fix file handle leak X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6aa586b2f83eeb776744c2e97a8ce9e1181c59b;p=libx264 mp4: Fix file handle leak --- diff --git a/output/mp4.c b/output/mp4.c index 2cf81f5a..c0af1189 100644 --- a/output/mp4.c +++ b/output/mp4.c @@ -169,8 +169,9 @@ static int open_file( char *psz_filename, hnd_t *p_handle, cli_output_opt_t *opt FILE *fh = x264_fopen( psz_filename, "w" ); if( !fh ) return -1; - FAIL_IF_ERR( !x264_is_regular_file( fh ), "mp4", "MP4 output is incompatible with non-regular file `%s'\n", psz_filename ) + int b_regular = x264_is_regular_file( fh ); fclose( fh ); + FAIL_IF_ERR( !b_regular, "mp4", "MP4 output is incompatible with non-regular file `%s'\n", psz_filename ) mp4_hnd_t *p_mp4 = calloc( 1, sizeof(mp4_hnd_t) ); if( !p_mp4 )