client/x11: Fix leak found by covscan
authorOndrej Holy <oholy@redhat.com>
Fri, 17 Aug 2018 12:28:55 +0000 (14:28 +0200)
committerOndrej Holy <oholy@redhat.com>
Wed, 22 Aug 2018 11:35:43 +0000 (13:35 +0200)
leaked_storage: Variable "actionScript" going out of scope leaks the storage it points to.

client/X11/xf_event.c

index c85a7db..01449d2 100644 (file)
@@ -183,6 +183,7 @@ BOOL xf_event_action_script_init(xfContext* xfc)
 
                if (!xevent || ArrayList_Add(xfc->xevents, xevent) < 0)
                {
+                       pclose(actionScript);
                        ArrayList_Free(xfc->xevents);
                        xfc->xevents = NULL;
                        return FALSE;