From 719b37c33a89d6ad86c79097e5c67b9b3cea5aac Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 29 Mar 2011 20:04:24 +0300 Subject: xfree86: fix memory leak in xf86LoadModules Signed-off-by: Tiago Vignatti Signed-off-by: Alan Coopersmith Reviewed-by: Nicolas Peninguy Reviewed-by: Peter Hutterer --- hw/xfree86/common/xf86Init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index e664ce451..0b36163c0 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1414,8 +1414,10 @@ xf86LoadModules(char **list, pointer *optlist) name = xf86NormalizeName(list[i]); /* Skip empty names */ - if (name == NULL || *name == '\0') + if (name == NULL || *name == '\0') { + free(name); continue; + } /* Replace obsolete keyboard driver with kbd */ if (!xf86NameCmp(name, "keyboard")) { -- cgit v1.2.3