[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libpst-commits
Subject:    [Libpst-commits] r51 - trunk
From:       jello () alioth ! debian ! org (Joseph Nahmias)
Date:       2006-12-07 5:46:25
Message-ID: E1GsB9L-0005cY-Rn () alioth ! debian ! org
[Download RAW message or body]

Author: jello
Date: 2006-12-07 05:46:23 +0100 (Thu, 07 Dec 2006)
New Revision: 51

Modified:
   trunk/libpst.c
Log:
_pst_build_id_ptr(): make sure buf is always freed

Modified: trunk/libpst.c
===================================================================
--- trunk/libpst.c	2006-12-07 04:02:23 UTC (rev 50)
+++ trunk/libpst.c	2006-12-07 04:46:23 UTC (rev 51)
@@ -520,6 +520,7 @@
     x = 0;
 
     if (_pst_read_block_size(pf, offset, BLOCK_SIZE, &buf, 0, 0) < BLOCK_SIZE) {
+      if (buf) free(buf);
       DEBUG_WARN(("Not read the full block size of the index. There is a \
problem\n"));  DEBUG_RET();
       return -1;
@@ -553,6 +554,7 @@
       //      if (index.u1 & 0x2 || index.u1 & 0x4) { 
       // ignore the above condition. it doesn't appear to hold
       if (old > index.id) { // then we have back-slid on the new values
+	if (buf) free(buf);
 	DEBUG_INDEX(("Back slider detected - Old value [%#x] greater than new [%#x]. \
Progressing to next table\n", old, index.id));  DEBUG_RET();
 	return 2;
@@ -600,6 +602,7 @@
     ret = 0;
 
     if (_pst_read_block_size(pf, offset, BLOCK_SIZE, &buf, 0, 0) < BLOCK_SIZE) {
+      if (buf) free(buf);
       DEBUG_WARN(("Not read the full block size of the index. There is a \
problem\n"));  DEBUG_RET();
       return -1;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic