[Python-checkins] python/dist/src/Modules _bsddb.c, 1.17.6.2, 1.17.6.3

greg at users.sourceforge.net greg at users.sourceforge.net
Thu Feb 26 05:21:24 EST 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21983/Modules

Modified Files:
      Tag: release23-maint
	_bsddb.c 
Log Message:
Fixes SF bsddb module bug 788421:
 * Fixed a bug in the compatibility interface set_location() method
   where it would not properly search to the next nearest key when
   used on BTree databases.  [SF bug id 788421]
 * Fixed a bug in the compatibility interface set_location() method
   where it could crash when looking up keys in a hash or recno
   format database due to an incorrect free().


Index: _bsddb.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v
retrieving revision 1.17.6.2
retrieving revision 1.17.6.3
diff -C2 -d -r1.17.6.2 -r1.17.6.3
*** _bsddb.c	21 Sep 2003 23:10:23 -0000	1.17.6.2
--- _bsddb.c	26 Feb 2004 10:21:12 -0000	1.17.6.3
***************
*** 94,98 ****
  #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
  
! #define PY_BSDDB_VERSION "4.2.0"
  static char *rcs_id = "$Id$";
  
--- 94,98 ----
  #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
  
! #define PY_BSDDB_VERSION "4.2.0.1"
  static char *rcs_id = "$Id$";
  
***************
*** 2912,2916 ****
              break;
          }
!         FREE_DBT(key);
          FREE_DBT(data);
      }
--- 2912,2924 ----
              break;
          }
!         if (_DB_get_type(self->mydb) == DB_BTREE) {
!             /* the only time a malloced key is returned is when we
!              * call this on a BTree database because it performs
!              * partial matching and needs to return the real key.
!              * All others leave key untouched [where calling free()
!              * on it would often segfault].
!              */
!             FREE_DBT(key);
!         }
          FREE_DBT(data);
      }




More information about the Python-checkins mailing list