aboutsummaryrefslogtreecommitdiff
path: root/src/Server.c
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-20 09:49:38 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-20 09:49:38 +0000
commitcb5cd7fc95e10d23c625798c1d5f627dcf8e8716 (patch)
tree4c9c9b592304da3d801b61d5a1941c8c00e55ac6 /src/Server.c
parent6b1dd294583ff99e3c8a160e9c3c10ca0751b566 (diff)
Check that there is something in the parsed expression before trying to
evaluate it. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@58 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/Server.c')
-rw-r--r--src/Server.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Server.c b/src/Server.c
index 6c1da0b..7364259 100644
--- a/src/Server.c
+++ b/src/Server.c
@@ -574,20 +574,22 @@ static int StatusUntilExpression(cGH *cctkGH)
}
}
- /* Make a copy */
- copy = Util_Strdup(parsed_expression);
-
- if(cctkGH)
+ if(parsed_expression && strlen(parsed_expression) > 0 && cctkGH)
{
+ /* Make a copy */
+ copy = Util_Strdup(parsed_expression);
+
/* Evaluate the expression */
retval = HTTP_ExpressionEvaluate(copy, evaluator, (void *)cctkGH);
+
+ /* Free the copy */
+ free(copy);
}
else
{
retval = 0;
}
- /* Free the copy */
- free(copy);
+
return retval;
}