From 9a893fe52f1bfd415e9ffd9d2f5aff5c4da7a756 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 3 Oct 2010 16:56:03 +0100 Subject: [PATCH] xfree86: Do not call dlclose(NULL) [regression after ab7f057] During unwind following an error when attempting to a load a module, we attempt to call dlclose on a potentially NULL handle. This is a side-effect of removing the abstraction layer in ab7f057. Signed-off-by: Chris Wilson Cc: Adam Jackson Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- hw/xfree86/loader/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index 89218312a2..694c1c2b07 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -184,7 +184,8 @@ void LoaderUnload(const char *name, void *handle) { xf86Msg(X_INFO, "Unloading %s\n", name); - dlclose(handle); + if (handle) + dlclose(handle); } unsigned long LoaderOptions = 0;