[Libpst-commits] r46 - trunk

Joseph Nahmias jello at alioth.debian.org
Thu Dec 7 02:42:09 CET 2006


Author: jello
Date: 2006-12-07 02:42:08 +0100 (Thu, 07 Dec 2006)
New Revision: 46

Modified:
   trunk/libpst.c
Log:
free wt in pst_load_extended_attributes()

Modified: trunk/libpst.c
===================================================================
--- trunk/libpst.c	2006-04-25 20:21:46 UTC (rev 45)
+++ trunk/libpst.c	2006-12-07 01:42:08 UTC (rev 46)
@@ -382,7 +382,6 @@
   pst_x_attrib xattrib;
   int32_t bptr = 0, bsize, hsize, tint, err=0, x;
   pst_x_attrib_ll *ptr, *p_head=NULL, *p_sh=NULL, *p_sh2=NULL;
-  char *wt;
 
   DEBUG_ENT("pst_loadExtendedAttributes");
   if ((p = _pst_getDptr(pf, 0x61)) == NULL) {
@@ -440,6 +439,7 @@
     if (xattrib.type & 0x0001) { // if the Bit 1 is set
       // pointer to Unicode field in buffer
       if (xattrib.extended < hsize) {
+        char *wt;
 	// copy the size of the header. It is 32 bit int
 	memcpy(&tint, &(headerbuffer[xattrib.extended]), sizeof(tint));
 	LE32_CPU(tint);
@@ -447,6 +447,7 @@
 	memset(wt, 0, tint+2);
 	memcpy(wt, &(headerbuffer[xattrib.extended+sizeof(tint)]), tint);
 	ptr->data = _pst_wide_to_single(wt, tint);
+	free(wt);
 	DEBUG_INDEX(("Read string (converted from UTF-16): %s\n", ptr->data));
       } else {
 	DEBUG_INDEX(("Cannot read outside of buffer [%i !< %i]\n", xattrib.extended, hsize));




More information about the Libpst-commits mailing list