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>
This commit is contained in:
parent
6e7417c342
commit
a54a766dfb
|
@ -103,7 +103,7 @@ Win32System(const char *cmdline)
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
DWORD dwExitCode;
|
DWORD dwExitCode;
|
||||||
char *cmd = xstrdup(cmdline);
|
char *cmd = strdup(cmdline);
|
||||||
|
|
||||||
ZeroMemory( &si, sizeof(si) );
|
ZeroMemory( &si, sizeof(si) );
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
|
@ -235,6 +235,11 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
|
||||||
xkm_output_dir, keymap);
|
xkm_output_dir, keymap);
|
||||||
|
|
||||||
free(xkbbasedirflag);
|
free(xkbbasedirflag);
|
||||||
|
|
||||||
|
if (!buf) {
|
||||||
|
LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
out= Popen(buf,"w");
|
out= Popen(buf,"w");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user