From 9f8095c06985bafb58272bc26374df7e81188cb9 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 21 Jul 2021 10:35:35 +0200 Subject: [PATCH] Make sure that we don't keep a reference on the LMDB key when using put_current --- milli/src/update/delete_documents.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/milli/src/update/delete_documents.rs b/milli/src/update/delete_documents.rs index 222f3b2d3..e6f847d01 100644 --- a/milli/src/update/delete_documents.rs +++ b/milli/src/update/delete_documents.rs @@ -366,6 +366,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> { // safety: we don't keep references from inside the LMDB database. unsafe { iter.del_current()? }; } else if docids.len() != previous_len { + let key = key.to_owned(); // safety: we don't keep references from inside the LMDB database. unsafe { iter.put_current(&key, &docids)? }; }