]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix descriptors leak on shmem detaching
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jun 2016 13:54:19 +0000 (14:54 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jun 2016 13:54:19 +0000 (14:54 +0100)
src/libutil/http.c

index 7196c922122e2390f68d0dedb0c908cedf492ab8..42d91b5cb8e7d9b010bba7a38bb7f27cffa84abd 100644 (file)
@@ -1524,6 +1524,12 @@ rspamd_http_detach_shared (struct rspamd_http_message *msg)
 {
        rspamd_fstring_t *cpy_str;
 
+       if (msg->body_buf.c.shared.shm_fd != -1) {
+               close (msg->body_buf.c.shared.shm_fd);
+       }
+
+       REF_RELEASE (msg->body_buf.c.shared.name);
+
        cpy_str = rspamd_fstring_new_init (msg->body_buf.begin, msg->body_buf.len);
        rspamd_http_message_set_body_from_fstring_steal (msg, cpy_str);
 }