diff --git a/programs/aes/aescrypt2.c b/programs/aes/aescrypt2.c index c291c1828..e761554fc 100644 --- a/programs/aes/aescrypt2.c +++ b/programs/aes/aescrypt2.c @@ -390,8 +390,10 @@ int main( int argc, char *argv[] ) ret = 0; exit: - fclose( fin ); - fclose( fout ); + if( fin ) + fclose( fin ); + if( fout ) + fclose( fout ); memset( buffer, 0, sizeof( buffer ) ); memset( digest, 0, sizeof( digest ) ); diff --git a/programs/aes/crypt_and_hash.c b/programs/aes/crypt_and_hash.c index 7014af0bd..4f1b2eca2 100644 --- a/programs/aes/crypt_and_hash.c +++ b/programs/aes/crypt_and_hash.c @@ -449,8 +449,10 @@ int main( int argc, char *argv[] ) ret = 0; exit: - fclose( fin ); - fclose( fout ); + if( fin ) + fclose( fin ); + if( fout ) + fclose( fout ); memset( buffer, 0, sizeof( buffer ) ); memset( digest, 0, sizeof( digest ) );