From 9e0b7f76f95dd45c99e95076badba2c8f123c31a Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 18 Sep 2013 20:57:39 -0700 Subject: clover: Fix memory leak when initializing a device object fails. Tested-by: Tom Stellard --- src/gallium/state_trackers/clover/core/platform.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/clover/core/platform.cpp b/src/gallium/state_trackers/clover/core/platform.cpp index e35b1f96da5..762a015ca1a 100644 --- a/src/gallium/state_trackers/clover/core/platform.cpp +++ b/src/gallium/state_trackers/clover/core/platform.cpp @@ -33,6 +33,8 @@ platform::platform() : adaptor_range(derefs(), devs) { for (pipe_loader_device *ldev : ldevs) { try { devs.push_back(transfer(new device(*this, ldev))); - } catch (error &) {} + } catch (error &) { + pipe_loader_release(&ldev, 1); + } } } -- cgit v1.2.3