]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport rev 55452:
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 19 May 2007 04:37:31 +0000 (04:37 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 19 May 2007 04:37:31 +0000 (04:37 +0000)
Whoops, need to pay attention to those test failures.
Move the clear to *before* the first use, not after.

Modules/_bsddb.c

index f064878966f47d57a9fe40e4f402e860b2df581e..e7613fb315982952ffd2193886dd31fb47daa52a 100644 (file)
@@ -1706,6 +1706,7 @@ DB_get_both(DBObject* self, PyObject* args, PyObject* kwargs)
     CHECK_DB_NOT_CLOSED(self);
     if (!make_key_dbt(self, keyobj, &key, NULL))
         return NULL;
+    CLEAR_DBT(data);
     if ( !make_dbt(dataobj, &data) ||
          !checkTxnObj(txnobj, &txn) )
     {
@@ -1713,7 +1714,6 @@ DB_get_both(DBObject* self, PyObject* args, PyObject* kwargs)
         return NULL;
     }
 
-    CLEAR_DBT(data);
     flags |= DB_GET_BOTH;
 
     if (CHECK_DBFLAG(self, DB_THREAD)) {