This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit b89b8094934856ae2f2b0e3bca83d3fe171f87b9
Author: Ulrich Sibiller <ul...@gmx.de>
Date:   Wed Jan 3 02:34:10 2018 +0100

    Error.c: replace malloc+strcpy by strdup
---
 nx-X11/programs/Xserver/hw/nxagent/Error.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c 
b/nx-X11/programs/Xserver/hw/nxagent/Error.c
index 7abd83a..f5fb297 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Error.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c
@@ -524,6 +524,7 @@ char *nxagentGetSessionPath(void)
       return NULL;
     }
 
+    /* FIXME: necessary? */
     snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s", rootPath);
 
     if (strlen(nxagentSessionDir) + strlen("/C-") + strlen(nxagentSessionId) > 
DEFAULT_STRING_LENGTH - 1)
@@ -562,9 +563,9 @@ char *nxagentGetSessionPath(void)
 
   }
 
-  sessionPath = malloc(strlen(nxagentSessionDir) + 1);
+  sessionPath = strdup(nxagentSessionDir);
 
-  if (sessionPath  == NULL)
+  if (sessionPath == NULL)
   {
     #ifdef PANIC
     fprintf(stderr, "nxagentGetSessionPath:: PANIC! Can't allocate memory for 
the session path.\n");
@@ -573,9 +574,6 @@ char *nxagentGetSessionPath(void)
     return NULL;
   }
 
-
-  strcpy(sessionPath, nxagentSessionDir);
-
   return sessionPath;
 }
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on 
/srv/git/code.x2go.org/nx-libs.git
_______________________________________________
x2go-commits mailing list
x2go-commits@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-commits

Reply via email to