diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-07 03:19:03 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-11 19:05:46 +0700 |
commit | a54a766dfb39fb3df671045878ac706215d83cef (patch) | |
tree | 2616c35000c2b7cbe15e406e4f8044756e872df6 /xkb/ddxLoad.c | |
parent | 6e7417c342b0624e3f3c5686bb43026786423692 (diff) |
xkb: replace xstrdup with strdup in Win32System
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@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb/ddxLoad.c')
-rw-r--r-- | xkb/ddxLoad.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index b1d629436..5e6ab8770 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); @@ -235,6 +235,11 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, xkm_output_dir, keymap); free(xkbbasedirflag); + + if (!buf) { + LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n"); + return FALSE; + } #ifndef WIN32 out= Popen(buf,"w"); |