Commit 122fbd3e authored by Ulrich Sibiller's avatar Ulrich Sibiller

Error.c: use SAFE_free

parent dde4e763
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "Error.h" #include "Error.h"
#include "Args.h" #include "Args.h"
#include "Utils.h"
/* /*
* Set here the required log level. * Set here the required log level.
...@@ -425,7 +426,7 @@ char *nxagentGetRootPath(void) ...@@ -425,7 +426,7 @@ char *nxagentGetRootPath(void)
"home directory '%s'.\n", homeEnv); "home directory '%s'.\n", homeEnv);
#endif #endif
free(homeEnv); SAFE_free(homeEnv);
return NULL; return NULL;
} }
...@@ -436,7 +437,7 @@ char *nxagentGetRootPath(void) ...@@ -436,7 +437,7 @@ char *nxagentGetRootPath(void)
snprintf(nxagentRootDir, DEFAULT_STRING_LENGTH, "%s/.nx", homeEnv); snprintf(nxagentRootDir, DEFAULT_STRING_LENGTH, "%s/.nx", homeEnv);
free(homeEnv); SAFE_free(homeEnv);
/* /*
* Create the NX root directory. * Create the NX root directory.
...@@ -534,14 +535,14 @@ char *nxagentGetSessionPath(void) ...@@ -534,14 +535,14 @@ char *nxagentGetSessionPath(void)
nxagentSessionDir); nxagentSessionDir);
#endif #endif
free(rootPath); SAFE_free(rootPath);
return NULL; return NULL;
} }
snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s/C-%s", rootPath, nxagentSessionId); snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s/C-%s", rootPath, nxagentSessionId);
free(rootPath); SAFE_free(rootPath);
if ((stat(nxagentSessionDir, &dirStat) == -1) && (errno == ENOENT)) if ((stat(nxagentSessionDir, &dirStat) == -1) && (errno == ENOENT))
{ {
...@@ -595,14 +596,14 @@ void nxagentGetClientsPath(void) ...@@ -595,14 +596,14 @@ void nxagentGetClientsPath(void)
fprintf(stderr, "nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.\n"); fprintf(stderr, "nxagentGetClientsPath: PANIC! Invalid value for the NX clients Log File Path ''.\n");
#endif #endif
free(sessionPath); SAFE_free(sessionPath);
return; return;
} }
snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s/clients", sessionPath); snprintf(nxagentClientsLogName, NXAGENTCLIENTSLOGNAMELENGTH, "%s/clients", sessionPath);
free(sessionPath); SAFE_free(sessionPath);
} }
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment