author | zautrix <zautrix> | 2004-12-04 14:45:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-04 14:45:53 (UTC) |
commit | b417f02504c962f692dad0b5e043243193b9f871 (patch) (unidiff) | |
tree | 0bd35e0916be791f5c21c012a0ad9ba9326857f9 /kmicromail/libetpan/mh/mailmh.c | |
parent | a3b1470f3da722d044505f78bef9de51b2107802 (diff) | |
download | kdepimpi-b417f02504c962f692dad0b5e043243193b9f871.zip kdepimpi-b417f02504c962f692dad0b5e043243193b9f871.tar.gz kdepimpi-b417f02504c962f692dad0b5e043243193b9f871.tar.bz2 |
comments added
Diffstat (limited to 'kmicromail/libetpan/mh/mailmh.c') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libetpan/mh/mailmh.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kmicromail/libetpan/mh/mailmh.c b/kmicromail/libetpan/mh/mailmh.c index 5e2b4cc..1087ce1 100644 --- a/kmicromail/libetpan/mh/mailmh.c +++ b/kmicromail/libetpan/mh/mailmh.c | |||
@@ -378,48 +378,53 @@ int mailmh_folder_update(struct mailmh_folder * folder) | |||
378 | mailmh_msg_info_free(msg_info); | 378 | mailmh_msg_info_free(msg_info); |
379 | res = MAILMH_ERROR_MEMORY; | 379 | res = MAILMH_ERROR_MEMORY; |
380 | goto closedir; | 380 | goto closedir; |
381 | } | 381 | } |
382 | msg_info->msg_array_index = array_index; | 382 | msg_info->msg_array_index = array_index; |
383 | 383 | ||
384 | if (index > max_index) | 384 | if (index > max_index) |
385 | max_index = index; | 385 | max_index = index; |
386 | 386 | ||
387 | #if 0 | 387 | #if 0 |
388 | r = cinthash_add(folder->fl_msgs_hash, msg_info->msg_index, msg_info); | 388 | r = cinthash_add(folder->fl_msgs_hash, msg_info->msg_index, msg_info); |
389 | #endif | 389 | #endif |
390 | key.data = &msg_info->msg_index; | 390 | key.data = &msg_info->msg_index; |
391 | key.len = sizeof(msg_info->msg_index); | 391 | key.len = sizeof(msg_info->msg_index); |
392 | data.data = msg_info; | 392 | data.data = msg_info; |
393 | data.len = 0; | 393 | data.len = 0; |
394 | 394 | ||
395 | r = chash_set(folder->fl_msgs_hash, &key, &data, NULL); | 395 | r = chash_set(folder->fl_msgs_hash, &key, &data, NULL); |
396 | if (r < 0) { | 396 | if (r < 0) { |
397 | carray_delete_fast(folder->fl_msgs_tab, msg_info->msg_array_index); | 397 | carray_delete_fast(folder->fl_msgs_tab, msg_info->msg_array_index); |
398 | mailmh_msg_info_free(msg_info); | 398 | mailmh_msg_info_free(msg_info); |
399 | res = MAILMH_ERROR_MEMORY; | 399 | res = MAILMH_ERROR_MEMORY; |
400 | goto closedir; | 400 | goto closedir; |
401 | } | 401 | } |
402 | //LR memory leak? added next line | ||
403 | //mailmh_msg_info_free(msg_info); | ||
404 | //it seems so that it should be freed later, | ||
405 | // but it is not in every case | ||
406 | //PENDING fixme in ompi somewhere | ||
402 | } | 407 | } |
403 | } | 408 | } |
404 | else if (S_ISDIR(buf.st_mode)) { | 409 | else if (S_ISDIR(buf.st_mode)) { |
405 | struct mailmh_folder * subfolder; | 410 | struct mailmh_folder * subfolder; |
406 | unsigned int array_index; | 411 | unsigned int array_index; |
407 | chashdatum key; | 412 | chashdatum key; |
408 | chashdatum data; | 413 | chashdatum data; |
409 | 414 | ||
410 | if (ent->d_name[0] == '.') { | 415 | if (ent->d_name[0] == '.') { |
411 | if (ent->d_name[1] == 0) | 416 | if (ent->d_name[1] == 0) |
412 | continue; | 417 | continue; |
413 | if ((ent->d_name[1] == '.') && (ent->d_name[2] == 0)) | 418 | if ((ent->d_name[1] == '.') && (ent->d_name[2] == 0)) |
414 | continue; | 419 | continue; |
415 | } | 420 | } |
416 | 421 | ||
417 | key.data = ent->d_name; | 422 | key.data = ent->d_name; |
418 | key.len = strlen(ent->d_name); | 423 | key.len = strlen(ent->d_name); |
419 | r = chash_get(folder->fl_subfolders_hash, &key, &data); | 424 | r = chash_get(folder->fl_subfolders_hash, &key, &data); |
420 | if (r < 0) { | 425 | if (r < 0) { |
421 | subfolder = mailmh_folder_new(folder, ent->d_name); | 426 | subfolder = mailmh_folder_new(folder, ent->d_name); |
422 | if (subfolder == NULL) { | 427 | if (subfolder == NULL) { |
423 | res = MAILMH_ERROR_MEMORY; | 428 | res = MAILMH_ERROR_MEMORY; |
424 | goto closedir; | 429 | goto closedir; |
425 | } | 430 | } |