aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap/MCIMAPSession.cpp
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-02-22 19:59:27 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-02-22 19:59:27 -0800
commitaf0d0dd4f57ee0745bc1910ef35fc7b88bf20613 (patch)
tree401131df76050142072b91dea660b5ad075fcece /src/core/imap/MCIMAPSession.cpp
parentcb5963c42d0cb69df12ea9e2b19cb61298b2831d (diff)
Fixed memory leak
Diffstat (limited to 'src/core/imap/MCIMAPSession.cpp')
-rwxr-xr-xsrc/core/imap/MCIMAPSession.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp
index 5af8a7bf..466ff936 100755
--- a/src/core/imap/MCIMAPSession.cpp
+++ b/src/core/imap/MCIMAPSession.cpp
@@ -3326,12 +3326,11 @@ IMAPIdentity * IMAPSession::identity(IMAPIdentity * clientIdentity, ErrorCode *
client_identification = mailimap_id_params_list_new_empty();
mc_foreacharray(String, key, clientIdentity->allInfoKeys()) {
- char * dup_name;
- char * dup_value;
-
- dup_name = strdup(key->UTF8Characters());
- dup_value = strdup(clientIdentity->infoForKey(key)->UTF8Characters());
- mailimap_id_params_list_add_name_value(client_identification, dup_name, dup_value);
+ MMAPString * mmap_str_name = mmap_string_new(key->UTF8Characters());
+ MMAPString * mmap_str_value = mmap_string_new(clientIdentity->infoForKey(key)->UTF8Characters());
+ mmap_string_ref(mmap_str_name);
+ mmap_string_ref(mmap_str_value);
+ mailimap_id_params_list_add_name_value(client_identification, mmap_str_name->str, mmap_str_value->str);
}
int r;