From f381c5ea8b37a1c98ff80beb81db22d0debd7494 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 24 Feb 2015 10:08:08 -0500 Subject: [PATCH] crs none: ensure file is != NULL before closing it This was CID 71701 --- opal/mca/crs/none/crs_none_module.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opal/mca/crs/none/crs_none_module.c b/opal/mca/crs/none/crs_none_module.c index c0da6f7c2b..42573a30ec 100644 --- a/opal/mca/crs/none/crs_none_module.c +++ b/opal/mca/crs/none/crs_none_module.c @@ -2,6 +2,7 @@ * Copyright (c) 2004-2010 The Trustees of Indiana University. * All rights reserved. * + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -151,7 +152,9 @@ int opal_crs_none_restart(opal_crs_base_snapshot_t *base_snapshot, bool spawn_ch } cleanup: - fclose(base_snapshot->metadata); + if (NULL != base_snapshot->metadata) { + fclose(base_snapshot->metadata); + } base_snapshot->metadata = NULL; return exit_status;