From 1dcbc673795447f63e231dbb60517818284eddcb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 6 Nov 2025 16:16:11 +0100 Subject: [PATCH] xfree86: parser: use standard asprintf() instead of our own implementation Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/parser/OutputClass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/parser/OutputClass.c b/hw/xfree86/parser/OutputClass.c index 856b4114e4..2591076f73 100644 --- a/hw/xfree86/parser/OutputClass.c +++ b/hw/xfree86/parser/OutputClass.c @@ -121,8 +121,9 @@ xf86parseOutputClassSection(void) if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING) Error(QUOTE_MSG, "ModulePath"); if (ptr->modulepath) { - char *path; - XNFasprintf(&path, "%s,%s", ptr->modulepath, xf86_lex_val.str); + char *path = NULL; + if (asprintf(&path, "%s,%s", ptr->modulepath, xf86_lex_val.str) == -1) + FatalError("xf86parseOutputClassSection() malloc failed\n"); free(xf86_lex_val.str); free(ptr->modulepath); ptr->modulepath = path;