xkb: XkbInitRules() don't hard-crash the server on strdup() fail

No need to hard-crash the whole server if some strdup() calls failing,
those fields already may be NULL, so consumers can handle that situation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-02-28 16:54:26 +01:00
parent 1bac33b0da
commit 65a17ca552

View File

@ -207,11 +207,11 @@ XkbInitRules(XkbRMLVOSet *rmlvo,
const char *variant, const char *variant,
const char *options) const char *options)
{ {
rmlvo->rules = rules ? XNFstrdup(rules) : NULL; rmlvo->rules = rules ? strdup(rules) : NULL;
rmlvo->model = model ? XNFstrdup(model) : NULL; rmlvo->model = model ? strdup(model) : NULL;
rmlvo->layout = layout ? XNFstrdup(layout) : NULL; rmlvo->layout = layout ? strdup(layout) : NULL;
rmlvo->variant = variant ? XNFstrdup(variant) : NULL; rmlvo->variant = variant ? strdup(variant) : NULL;
rmlvo->options = options ? XNFstrdup(options) : NULL; rmlvo->options = options ? strdup(options) : NULL;
} }
static void static void