From 331ef3232fe36c9783adf6092f2a5bfb74ec0f19 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Wed, 14 Aug 2019 11:26:55 +0100 Subject: [PATCH] src/Input/FGEventInput.cxx: FGEventInput::AddDevice(): fix incorrect use after delete. Moved delete of inputDevice to after its use in a SG_LOG diagnostic. --- src/Input/FGEventInput.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx index 5c4899073..2d62e7809 100644 --- a/src/Input/FGEventInput.cxx +++ b/src/Input/FGEventInput.cxx @@ -490,8 +490,8 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice ) } } catch( ... ) { - delete inputDevice; SG_LOG(SG_INPUT, SG_ALERT, "can't open InputDevice " << inputDevice->GetUniqueName() ); + delete inputDevice; return INVALID_DEVICE_INDEX; }