summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorAaron Watry <[email protected]>2013-11-08 13:45:05 -0600
committerAaron Watry <[email protected]>2013-12-23 07:24:50 -0600
commita7653c19a3b1adae162864587a7ab1c17ab256e6 (patch)
tree29a924ff567e197ccc47efe42acfa09cec52d865 /src/gallium/auxiliary
parent862f55c29c50798942e58ea75c5294921c0489f8 (diff)
pipe_loader/sw: close dev->lib when initialization fails
Prevents a memory leak. Reviewed-by: Tom Stellard <[email protected]> CC: "10.0" <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c5
1 files changed, 4 insertions, 1 deletions
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);
}