aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-29 13:34:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-29 13:34:45 +0100
commit72dabec06849a0b6db6bcf009a63a7e3c08b7563 (patch)
treebb10ae5e33151e8bc1978974858861a21343e2e6
parentc54d877fddc5b015692a8d0f273cdf0d0da980db (diff)
downloadrspamd-72dabec06849a0b6db6bcf009a63a7e3c08b7563.tar.gz
rspamd-72dabec06849a0b6db6bcf009a63a7e3c08b7563.zip
[Fix] Fix memory leak in unsigned maps reading
-rw-r--r--src/libutil/map.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 171719b5e..7731cfea9 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -380,15 +380,9 @@ http_map_finish (struct rspamd_http_connection *conn,
else {
/* Unsinged version - just open file */
cbd->shmem_data = rspamd_http_message_shmem_ref (msg);
- in = rspamd_shmem_xmap (cbd->shmem_data->shm_name, PROT_READ, &inlen);
cbd->data_len = msg->body_buf.len;
- if (in == NULL) {
- msg_err_map ("cannot read tempfile %s: %s",
- cbd->shmem_data->shm_name,
- strerror (errno));
- goto err;
- }
+ goto read_data;
}
}
else if (cbd->stage == map_load_pubkey) {
@@ -470,6 +464,7 @@ http_map_finish (struct rspamd_http_connection *conn,
munmap (in, dlen);
}
+read_data:
g_assert (cbd->shmem_data != NULL);
in = rspamd_shmem_xmap (cbd->shmem_data->shm_name, PROT_READ, &dlen);