]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix order of descriptor closing
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 7 Jul 2025 10:02:13 +0000 (11:02 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 7 Jul 2025 10:02:13 +0000 (11:02 +0100)
src/libserver/http/http_router.c

index aca791a273f6d7ca89109a13ad8af284a6f28d72..459401e9e430e4fec2c530443bca25f2e5b6a9fb 100644 (file)
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2019 Vsevolod Stakhov
+/*
+ * Copyright 2025 Vsevolod Stakhov
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -56,13 +56,13 @@ static void
 rspamd_http_entry_free(struct rspamd_http_connection_entry *entry)
 {
        if (entry != NULL) {
-               close(entry->conn->fd);
                rspamd_http_connection_unref(entry->conn);
                if (entry->rt->finish_handler) {
                        entry->rt->finish_handler(entry);
                }
 
                DL_DELETE(entry->rt->conns, entry);
+               close(entry->conn->fd);
                g_free(entry);
        }
 }