From a7653c19a3b1adae162864587a7ab1c17ab256e6 Mon Sep 17 00:00:00 2001 From: Aaron Watry Date: Fri, 8 Nov 2013 13:45:05 -0600 Subject: pipe_loader/sw: close dev->lib when initialization fails Prevents a memory leak. Reviewed-by: Tom Stellard CC: "10.0" --- src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/pipe-loader') diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c index c2b78c636a7..382e116fd06 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c @@ -95,8 +95,11 @@ pipe_loader_sw_create_screen(struct pipe_loader_device *dev, return NULL; init = (void *)util_dl_get_proc_address(sdev->lib, "swrast_create_screen"); - if (!init) + if (!init){ + util_dl_close(sdev->lib); + sdev->lib = NULL; return NULL; + } return init(sdev->ws); } -- cgit v1.2.3