[Libpst-devel] Yet more memory leaks plpugged

Nigel Horne njh at bandsman.co.uk
Wed Apr 26 14:21:07 UTC 2006


Getting toward the end of memory leaks I hope!

-Nigel Horne

*** Olibpst.c	Wed Apr 26 15:18:02 2006
--- libpst.c	Wed Apr 26 15:19:12 2006
***************
*** 395,400 ****
--- 395,401 ----
      return 0;
    }
    if ((na = _pst_parse_block(pf, p->desc->id, list2)) == NULL) {
+ 	_pst_free_id2(list2);
      DEBUG_WARN(("Cannot process desc block for item 0x61. Not loading extended Attributes\n"));
      DEBUG_RET();
      return 0;
***************
*** 412,417 ****
--- 413,419 ----
    }
  
    if (buffer == NULL) {
+ 	_pst_free_id2(list2);
      DEBUG_WARN(("No extended attributes buffer found. Not processing\n"));
      DEBUG_RET();
      return 0;
***************
*** 486,495 ****
      LE16_CPU(xattrib.map);
      bptr += sizeof(xattrib);
    }
!   if (buffer)
!     free(buffer);
!   if (headerbuffer)
!     free(headerbuffer);
    pf->x_head = p_head;
    DEBUG_RET();
    return 1;
--- 488,495 ----
      LE16_CPU(xattrib.map);
      bptr += sizeof(xattrib);
    }
! 	_pst_free_list(na);
! 	_pst_free_id2(list2);
    pf->x_head = p_head;
    DEBUG_RET();
    return 1;



More information about the Libpst-devel mailing list