From: Vsevolod Stakhov Date: Thu, 16 Jun 2016 13:54:19 +0000 (+0100) Subject: [Fix] Fix descriptors leak on shmem detaching X-Git-Tag: 1.3.0~317 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a5e9eb0d746468340e29f291ea5488ff0946c97;p=thirdparty%2Frspamd.git [Fix] Fix descriptors leak on shmem detaching --- diff --git a/src/libutil/http.c b/src/libutil/http.c index 7196c92212..42d91b5cb8 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); }