summaryrefslogtreecommitdiff
path: root/src/main/Parameters.c
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-11-07 00:19:15 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-11-07 00:19:15 +0000
commite750e45c9b3ad52763a99452fc3d33bdb4d79318 (patch)
tree55085f18fca489b833ffa737de631c2a3762be5e /src/main/Parameters.c
parentafd6f53a51a80f0a83b0e973cea1dbe2a1178bfb (diff)
Fixing some unprotected mallocs spotted by Ian Hawke.
Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2458 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Parameters.c')
-rw-r--r--src/main/Parameters.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c
index 6dba540d..c5b65aa8 100644
--- a/src/main/Parameters.c
+++ b/src/main/Parameters.c
@@ -725,6 +725,10 @@ int CCTK_ParameterWalk (int first,
static t_param *prev_startpoint_all = NULL;
static t_param *prev_startpoint_thorn = NULL;
+ /* FIXME : This routine has become extremely ugly:
+ * It should only have one return in it.
+ * The malloc failure should be flagged.
+ */
/* determine the startpoint for search */
if (! first)
@@ -785,7 +789,10 @@ int CCTK_ParameterWalk (int first,
*pfullname = (char *) malloc (strlen (prefix) +
strlen (startpoint->props->name) + 3);
- sprintf (*pfullname, "%s::%s", prefix, startpoint->props->name);
+ if(*pfullname)
+ {
+ sprintf (*pfullname, "%s::%s", prefix, startpoint->props->name);
+ }
}
if (pdata)