]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In 1.17.6.4 part of the patch committed in 1.17.6.3 got reapplied to
authorGregory P. Smith <greg@mad-scientist.com>
Sun, 19 Dec 2004 23:27:48 +0000 (23:27 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sun, 19 Dec 2004 23:27:48 +0000 (23:27 +0000)
the end of a second function whos code was identical enough for patch
not to reject the patch.  this reverses that misapplication (only the
DBC_set_range method needed modification, not DBC_set as well).  This
problem only exists in the release32-maint branch.

Modules/_bsddb.c

index 3e97f881169faec04b05aaa5cf6a8508fa96ea5a..5995848687051d009cd8ef43bb1fcad01780a1ae 100644 (file)
@@ -2849,15 +2849,7 @@ DBC_set(DBCursorObject* self, PyObject* args, PyObject *kwargs)
                                    data.data, data.size);
             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(key);
         FREE_DBT(data);
     }