From: Francisco Jerez Date: Thu, 19 Sep 2013 03:57:39 +0000 (-0700) Subject: clover: Fix memory leak when initializing a device object fails. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e0b7f76f95dd45c99e95076badba2c8f123c31a;p=mesa.git clover: Fix memory leak when initializing a device object fails. Tested-by: Tom Stellard --- 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); + } } }