diff options
author | David Tardon <dtardon@redhat.com> | 2022-08-10 14:00:53 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2022-09-13 08:13:42 +0200 |
commit | c9958c4fc55a916885defc3f91f4b0834ba891b4 (patch) | |
tree | bb0c27eef9b639ba177da87d49de35fbd62d514e /src/socket-proxy | |
parent | tree-wide: use ASSERT_PTR more (diff) | |
download | systemd-c9958c4fc55a916885defc3f91f4b0834ba891b4.tar.xz systemd-c9958c4fc55a916885defc3f91f4b0834ba891b4.zip |
tree-wide: check parameter before dereferencing
Diffstat (limited to 'src/socket-proxy')
-rw-r--r-- | src/socket-proxy/socket-proxyd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 7fef53f00d..68d13b795a 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -95,9 +95,13 @@ static int idle_time_cb(sd_event_source *s, uint64_t usec, void *userdata) { } static int connection_release(Connection *c) { - Context *context = c->context; + Context *context; int r; + assert(c); + + context = ASSERT_PTR(c->context); + connection_free(c); if (arg_exit_idle_time < USEC_INFINITY && set_isempty(context->connections)) { |