union _rspamd_storage_u *storage;
struct stat st;
- if (msg->body_buf.len != 0) {
- if (msg->flags & RSPAMD_HTTP_FLAG_SHMEM) {
- storage = &msg->body_buf.c;
-
- if (storage->shared.shm_fd != -1) {
- g_assert (fstat (storage->shared.shm_fd, &st) != -1);
+ if (msg->flags & RSPAMD_HTTP_FLAG_SHMEM) {
+ storage = &msg->body_buf.c;
- if (msg->body_buf.str != MAP_FAILED) {
- munmap (msg->body_buf.str, st.st_size);
- }
+ if (storage->shared.shm_fd != -1) {
+ g_assert (fstat (storage->shared.shm_fd, &st) != -1);
- close (storage->shared.shm_fd);
+ if (msg->body_buf.str != MAP_FAILED) {
+ munmap (msg->body_buf.str, st.st_size);
}
- if (storage->shared.name != NULL) {
- REF_RELEASE (storage->shared.name);
- }
+ close (storage->shared.shm_fd);
+ }
- storage->shared.shm_fd = -1;
- msg->body_buf.str = MAP_FAILED;
+ if (storage->shared.name != NULL) {
+ REF_RELEASE (storage->shared.name);
}
- else {
+
+ storage->shared.shm_fd = -1;
+ msg->body_buf.str = MAP_FAILED;
+ }
+ else {
+ if (msg->body_buf.c.normal) {
rspamd_fstring_free (msg->body_buf.c.normal);
- msg->body_buf.c.normal = NULL;
}
- msg->body_buf.len = 0;
+ msg->body_buf.c.normal = NULL;
}
+
+ msg->body_buf.len = 0;
}
void