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)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 May 2021 19:45:32 +0000 (21:45 +0200)
commitd65e974e67e47222cdebd9d0b6becd6642547ce2
tree4c11d8dbe03ada5924bd9604b474755b714ba23d
parentcc6b0a18ff73325e2ecf0c5d857f4fdca75d97b4
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
src/core/core-varlink.c