Signed-off-by: Aaron Watry <[email protected]>
CC: Ilia Mirkin <[email protected]>
v4: Call dlerror() twice instead of freeing glibc's memory.
Prevents issues on C Libraries that don't malloc the error string.
v3: Switch comment to C-Style
v2: Use strdup instead of calloc/strcpy
---
src/gallium/auxiliary/pipe-loader/pipe_loader.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index 8e79f85..f103497 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -25,6 +25,8 @@
*
**************************************************************************/
+#include <dlfcn.h>
+
#include "pipe_loader_priv.h"
#include "util/u_inlines.h"
@@ -101,6 +103,10 @@ pipe_loader_find_module(struct pipe_loader_device *dev,
if (lib) {
return lib;
}
+
+ /* Retrieve the dlerror() str twice. Once to populate the error,
twice to clear it. */
+ dlerror();
+ dlerror();
}
}
--
2.1.0
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev