core: don't accidentally unref a varlink connection twice
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Mar 2021 21:21:58 +0000 (22:21 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 May 2021 16:28:19 +0000 (18:28 +0200)
commit68da6997a9323c127a45ca019d32fa97ff0d7cca
tree23496b3291d55f41543e52fc84ebe44b14154bd4
parent906b89a284308a64e599e7e4230763bb60a16895
core: don't accidentally unref a varlink connection twice

Let's make sure that our close handler unrefs a connection again that we
are already unreffing a few stack frames up by invalidating the pointer
first, and dropping the ref counter only after that.

Replaces: 39ad3f1c092b5dffcbb4b1d12eb9ca407f010a3c

Fixes: #18025
(cherry picked from commit d65e974e67e47222cdebd9d0b6becd6642547ce2)
src/core/core-varlink.c