From 65a17ca55213a071e9b677bf43877bd8c7486152 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 28 Feb 2025 16:54:26 +0100 Subject: [PATCH] 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 --- xkb/xkbInit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 5a6bde92f..ef72eba3a 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -207,11 +207,11 @@ XkbInitRules(XkbRMLVOSet *rmlvo, const char *variant, const char *options) { - rmlvo->rules = rules ? XNFstrdup(rules) : NULL; - rmlvo->model = model ? XNFstrdup(model) : NULL; - rmlvo->layout = layout ? XNFstrdup(layout) : NULL; - rmlvo->variant = variant ? XNFstrdup(variant) : NULL; - rmlvo->options = options ? XNFstrdup(options) : NULL; + rmlvo->rules = rules ? strdup(rules) : NULL; + rmlvo->model = model ? strdup(model) : NULL; + rmlvo->layout = layout ? strdup(layout) : NULL; + rmlvo->variant = variant ? strdup(variant) : NULL; + rmlvo->options = options ? strdup(options) : NULL; } static void