[PATCH 8/8] xkb: replace xstrdup with strdup in Win32System

Mikhail Gusarov dottedmag at dottedmag.net
Fri Jun 4 03:25:05 PDT 2010


The only caller of Win32System is XkbDDXCompileKeymapByNames. Add allocation
check there to avoid passing NULL pointers to various functions down the code.

Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
 xkb/ddxLoad.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index b1d6294..9431e9a 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -103,7 +103,7 @@ Win32System(const char *cmdline)
     STARTUPINFO si;
     PROCESS_INFORMATION pi;
     DWORD dwExitCode;
-    char *cmd = xstrdup(cmdline);
+    char *cmd = strdup(cmdline);
 
     ZeroMemory( &si, sizeof(si) );
     si.cb = sizeof(si);
@@ -225,7 +225,7 @@ XkbDDXCompileKeymapByNames(	XkbDescPtr		xkb,
 	}
     }
 
-    buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
+    buf = XNFprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
 		  "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
 		  xkbbindir, xkbbindirsep,
 		  ( (xkbDebugFlags < 2) ? 1 :
-- 
1.7.1



More information about the xorg-devel mailing list