]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
stream-service: Avoid FD leak during deinitialization
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Mar 2025 13:41:03 +0000 (14:41 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 4 Mar 2025 13:41:03 +0000 (14:41 +0100)
src/libstrongswan/networking/streams/stream_service.c

index 7f69c85d3334ef5b81d67245db17f8925be08b50..5b709a2247db26fd44f3bb70328546ee1544ccc5 100644 (file)
@@ -226,6 +226,10 @@ static bool watch(private_stream_service_t *this, int fd, watcher_event_t event)
        }
        else
        {
+               if (data->fd != -1)
+               {
+                       close(data->fd);
+               }
                free(data);
        }
        return keep;