From 2d51c817cdff6ada200e80ecb6819a641aebc462 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Fri, 12 Feb 2016 19:08:42 +0100 Subject: [PATCH] st/nine: Fix leak after ctor failures Previously ctor failures would not unreference the device. Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/iunknown.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.30.2