aboutsummaryrefslogtreecommitdiff
path: root/src/Redirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Redirect.c')
-rw-r--r--src/Redirect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Redirect.c b/src/Redirect.c
index b7b7139..32cee44 100644
--- a/src/Redirect.c
+++ b/src/Redirect.c
@@ -40,7 +40,7 @@ CCTK_FILEVERSION(CactusConnect_HTTPD_Redirect_c)
********************************************************************/
static void RegisterRedirect(void);
-static int RedirectPage(cGH *cctkGH, httpRequest *request, void *data);
+static int RedirectPage(const cGH *cctkGH, httpRequest *request, void *data);
/********************************************************************
********************* Other Routine Prototypes *********************
@@ -96,8 +96,7 @@ int HTTP_SetupRedirect(int port,
#endif
memset(hostnm,0,addrlen);
Util_GetHostName(hostnm, addrlen);
- alladdr=(char*)malloc(addrlen * nprocs);
- memset(alladdr,0,addrlen*nprocs); /* zero it */
+ alladdr = (char *) calloc (addrlen, nprocs);
#ifdef CCTK_MPI
{ /* push stack */
@@ -158,6 +157,8 @@ int HTTP_SetupRedirect(int port,
httpredirect=0;
}
+ free (alladdr);
+
return retval;
}
@@ -285,7 +286,7 @@ static void RegisterRedirect(void)
@@*/
-static int RedirectPage(cGH *cctkGH, httpRequest *request, void *data)
+static int RedirectPage(const cGH *cctkGH, httpRequest *request, void *data)
{
int retval;
char message[1024];