diff --git a/orte/tools/orte-ps/orte-ps.c b/orte/tools/orte-ps/orte-ps.c index 196470ed7c..9c008cd32a 100644 --- a/orte/tools/orte-ps/orte-ps.c +++ b/orte/tools/orte-ps/orte-ps.c @@ -14,7 +14,7 @@ * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -651,7 +651,11 @@ static int pretty_print_vpids(orte_job_t *job) { char *snap_ref = NULL; char *snap_loc = NULL; #endif - char **nodename; + char **nodename = NULL; + + if (0 == job->num_procs) { + return ORTE_SUCCESS; + } /* * Caculate segment lengths @@ -808,7 +812,9 @@ static int pretty_print_vpids(orte_job_t *job) { printf("\n"); } - + if (NULL != nodename) { + free(nodename); + } return ORTE_SUCCESS; }