diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-16 14:54:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-16 14:54:19 +0100 |
commit | 1a5e9eb0d746468340e29f291ea5488ff0946c97 (patch) | |
tree | efbbf61c2fd571bfd2c7507d1da9c5f2b6f41b87 /src/libutil/http.c | |
parent | 2fb4f616ceb7d4121b3a1cbad591e1fa68d71475 (diff) | |
download | rspamd-1a5e9eb0d746468340e29f291ea5488ff0946c97.tar.gz rspamd-1a5e9eb0d746468340e29f291ea5488ff0946c97.zip |
[Fix] Fix descriptors leak on shmem detaching
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r-- | src/libutil/http.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index 7196c9221..42d91b5cb 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -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); } |