From e43187d59d66deeda6be2c459f5a75c347b76a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sat, 14 Feb 2015 16:01:34 +0000 Subject: [PATCH] Fix possible fd leak in test file --- tests/suites/test_suite_mpi.function | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_mpi.function index 795d2a022..ce1a07205 100644 --- a/tests/suites/test_suite_mpi.function +++ b/tests/suites/test_suite_mpi.function @@ -97,6 +97,7 @@ void mpi_read_file( int radix_X, char *input_file, char *input_A, unsigned char buf[1000]; size_t buflen; FILE *file; + int ret; memset( buf, 0x00, 1000 ); memset( str, 0x00, 1000 ); @@ -105,8 +106,9 @@ void mpi_read_file( int radix_X, char *input_file, char *input_A, file = fopen( input_file, "r" ); TEST_ASSERT( file != NULL ); - TEST_ASSERT( mpi_read_file( &X, radix_X, file ) == result ); + ret = mpi_read_file( &X, radix_X, file ); fclose(file); + TEST_ASSERT( ret == result ); if( result == 0 ) {