diff --git a/src/tests/test_db_donotindex.c b/src/tests/test_db_donotindex.c
index a09973e06246e05a680665116d5d243f08f1ee1e..b84a12968a409d6b4b8f90355c88cfe66ff9cdcb 100644
--- a/src/tests/test_db_donotindex.c
+++ b/src/tests/test_db_donotindex.c
@@ -59,7 +59,7 @@ int getskey(DB *secondary, const DBT *pkey, const DBT *pdata, DBT *skey)
 	memset(skey, 0, sizeof(DBT));
 	entry = (DATA*)pdata->data;
 
-    if (callback_set_malloc) skey->flags = DB_DBT_MALLOC;
+    if (callback_set_malloc) skey->flags = DB_DBT_APPMALLOC;
     if (callback_init_data) {
         skey->size = sizeof(entry->skey);
         if (callback_set_malloc) {