[Libpst-commits] r48 - trunk
Joseph Nahmias
jello at alioth.debian.org
Thu Dec 7 03:57:45 CET 2006
Author: jello
Date: 2006-12-07 03:57:45 +0100 (Thu, 07 Dec 2006)
New Revision: 48
Modified:
trunk/libpst.c
Log:
make sure buf is freed in _pst_build_desc_ptr()
Modified: trunk/libpst.c
===================================================================
--- trunk/libpst.c 2006-12-07 01:59:34 UTC (rev 47)
+++ trunk/libpst.c 2006-12-07 02:57:45 UTC (rev 48)
@@ -706,6 +706,7 @@
if (pf->index2_depth-depth == 0) {
// leaf node
if (_pst_read_block_size(pf, offset, DESC_BLOCK_SIZE, &buf, 0, 0) < DESC_BLOCK_SIZE) {
+ if (buf) free(buf);
DEBUG_WARN(("I didn't get all the index that I wanted. _pst_read_block_size returned less than requested\n"));
DEBUG_RET();
return -1;
@@ -995,6 +996,7 @@
} else {
// hopefully a table of offsets to more tables
if (_pst_read_block_size(pf, offset, DESC_BLOCK_SIZE, &buf, 0, 0) < DESC_BLOCK_SIZE) {
+ if (buf) free(buf);
DEBUG_WARN(("didn't read enough desc index. _pst_read_block_size returned less than requested\n"));
DEBUG_RET();
return -1;
More information about the Libpst-commits
mailing list