p;key, &amp;value, DB_NEXT);
        switch (ret) {
            case 0:
                count++;
                break;
            case DB_NOTFOUND:
                break;
            default:
                dbp-&gt;err(dbp, ret, 
                    "Count records unspecified error");
                goto cursor_err;
        }
    } while (ret == 0);

cursor_err:
    if (cursorp != NULL) {
        ret = cursorp-&gt;close(cursorp);
        if (ret != 0) {
            dbp-&gt;err(dbp, ret,
                