diff options
Diffstat (limited to 'src/Sockets.c')
-rw-r--r-- | src/Sockets.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 33c8162..59844be 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -49,6 +49,7 @@ #include "IsoSurfacerInit.h" #include "IsoSurfacerGH.h" +#include "util_String.h" static const char *rcsid = "$Header$"; @@ -144,7 +145,7 @@ static int chosen_controlport = 0; static int chosen_dataport = 0; #define FILENAME_TEMPLATE "fileXXXXXX" -static char *advertised_filename = FILENAME_TEMPLATE; +static char *advertised_filename; /******************************************************************** @@ -168,7 +169,9 @@ int Iso_SetupServer(const cGH *GH,isosurfacerGH *myGH,int dataport, int controlp FILE *advertised_file_fd; char hostname[1025]; - + advertised_filename = Util_Strdup(FILENAME_TEMPLATE); + if (advertised_filename == NULL) + CCTK_VWarn 0, __LINE__, __FILE__, "IsoSurfacer", "Cannot allocate memory foradvertised file name"); myGH = myGH; if(CCTK_MyProc(GH) != 0) return 0; /* not the root processor */ @@ -267,7 +270,7 @@ int Iso_ShutdownServer(void) { remove (advertised_filename); } - + free (advertised_filename); return (0); } |