From: Axel Davy Date: Fri, 12 Feb 2016 18:08:42 +0000 (+0100) Subject: st/nine: Fix leak after ctor failures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d51c817cdff6ada200e80ecb6819a641aebc462;p=mesa.git st/nine: Fix leak after ctor failures Previously ctor failures would not unreference the device. Signed-off-by: Axel Davy --- diff --git a/src/gallium/state_trackers/nine/iunknown.c b/src/gallium/state_trackers/nine/iunknown.c index a28c8b2de8b..515ceaa263f 100644 --- a/src/gallium/state_trackers/nine/iunknown.c +++ b/src/gallium/state_trackers/nine/iunknown.c @@ -48,6 +48,8 @@ NineUnknown_ctor( struct NineUnknown *This, void NineUnknown_dtor( struct NineUnknown *This ) { + if (This->refs && This->device) /* Possible only if early exit after a ctor failed */ + (void) NineUnknown_Release(NineUnknown(This->device)); FREE(This); }