diff options
author | NIkita-Ruzanov <nikita.ruzanov@gmail.com> | 2016-04-07 22:48:11 +0300 |
---|---|---|
committer | HoĆ V. DINH <dinh.viet.hoa@gmail.com> | 2016-04-07 12:48:10 -0700 |
commit | 3ad52b208aa5d637a249bbaaee3aa13fcb5566d2 (patch) | |
tree | 2706553c4767d77177850610340365533afa7481 /src/core | |
parent | 1225473d8973aafe24619f0b9ec48f7567da6f18 (diff) |
Fix for high memory usage during loggin of large request (#1396)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/smtp/MCSMTPSession.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/smtp/MCSMTPSession.cpp b/src/core/smtp/MCSMTPSession.cpp index 166a58cd..758f5c65 100644 --- a/src/core/smtp/MCSMTPSession.cpp +++ b/src/core/smtp/MCSMTPSession.cpp @@ -230,8 +230,10 @@ static void logger(mailsmtp * smtp, int log_type, const char * buffer, size_t si bool isBuffer = isBufferFromLogType(log_type); if (isBuffer) { + AutoreleasePool * pool = new AutoreleasePool(); Data * data = Data::dataWithBytes(buffer, (unsigned int) size); session->connectionLoggerNoLock()->log(session, type, data); + pool->release(); } else { session->connectionLoggerNoLock()->log(session, type, NULL); |