pipe_loader/sw: close dev->lib when initialization fails
authorAaron Watry <awatry@gmail.com>
Fri, 8 Nov 2013 19:45:05 +0000 (13:45 -0600)
committerAaron Watry <awatry@gmail.com>
Mon, 23 Dec 2013 13:24:50 +0000 (07:24 -0600)
Prevents a memory leak.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
CC: "10.0" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c

index c2b78c636a79f4bbf4691e0f24d956a2597fec51..382e116fd06d9d4276da5b1e272ea296db3d4319 100644 (file)
@@ -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);
 }