From 535408d6c2a668ba2f66b47d18ff1f27e2dcd6a8 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 21 Aug 2009 12:41:54 +0000 Subject: [PATCH] Answer a Jeff-ism and check malloc for NULL return - for all xml formatting errors, revert to at least showing the non-xml formatted message This commit was SVN r21862. --- orte/util/show_help.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/orte/util/show_help.c b/orte/util/show_help.c index 8f44f3d82c..3188c87b3b 100644 --- a/orte/util/show_help.c +++ b/orte/util/show_help.c @@ -159,6 +159,10 @@ static char* xml_format(unsigned char *input) len = strlen((char*)input); /* add some arbitrary size padding */ output = (char*)malloc((len+1024)*sizeof(char)); + if (NULL == output) { + ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); + return (char*)input; /* default to no xml formatting */ + } memset(output, 0, len+1024); outlen = len+1023; endtaglen = strlen(endtag);