[PATCH] Fix segfault when there's no config dir

przanoni at gmail.com przanoni at gmail.com
Fri Nov 25 10:38:06 PST 2011


From: Paulo Zanoni <paulo.r.zanoni at intel.com>

Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
 hw/xfree86/parser/scan.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Sorry. I guess this should be pushed soon...

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 9b6c356..31c6499 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -855,8 +855,8 @@ OpenConfigDir(const char *path, const char *cmdline, const char *projroot,
 			free(dirpath);
 			dirpath = NULL;
 		}
-		while (num--)
-			free(list[num]);
+		while (num > 0)
+			free(list[--num]);
 		free(list);
 	}
 
-- 
1.7.7.1



More information about the xorg-devel mailing list