]> git.saurik.com Git - apple/libc.git/blobdiff - db/btree/bt_seq-fbsd.c
Libc-583.tar.gz
[apple/libc.git] / db / btree / bt_seq-fbsd.c
index 662e1953573678719e1cca740a2e4c89935d04a1..5cac84bc7e51a9e6e24bf462fa50764e4bcf936f 100644 (file)
@@ -387,18 +387,19 @@ __bt_first(t, key, erval, exactp)
                         * occurs.
                         */
                        if (ep->index == 0) {
+                               PAGE *hprev;
                                if (h->prevpg == P_INVALID)
                                        break;
                                if (h->pgno != save.page->pgno)
                                        mpool_put(t->bt_mp, h, 0);
-                               if ((h = mpool_get(t->bt_mp,
+                               if ((hprev = mpool_get(t->bt_mp,
                                    h->prevpg, 0)) == NULL) {
                                        if (h->pgno == save.page->pgno)
                                                mpool_put(t->bt_mp,
                                                    save.page, 0);
                                        return (RET_ERROR);
                                }
-                               ep->page = h;
+                               ep->page = h = hprev;
                                ep->index = NEXTINDEX(h);
                        }
                        --ep->index;