diff --git a/src/mapping.c b/src/mapping.c
index c8912f608a9ddb2e0f45904fbc4e6db0f81ce235..54675d3732feb591643a87b95bf0533deeb90398 100644
--- a/src/mapping.c
+++ b/src/mapping.c
@@ -112,6 +112,11 @@ BLOCK_ALLOC_FILL_PAGES(mapping, 2)
   } while(0)
 #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */
 
+void mapping_free_keypair(struct mapping_data *md, struct keypair *k)
+{
+  FREE_KEYPAIR(md, k);
+}
+
 #ifdef PIKE_DEBUG
 
 /** This function checks that the type field isn't lacking any bits.
diff --git a/src/mapping.h b/src/mapping.h
index 3d8087edcf589b8b751221797ae52f7d635bbdba..207e394c45979fc793cff6c24ebb26bf4452e138 100644
--- a/src/mapping.h
+++ b/src/mapping.h
@@ -140,6 +140,8 @@ BLOCK_ALLOC_FILL_PAGES(mapping, 2);
 
 
 
+void mapping_free_keypair(struct mapping_data *md, struct keypair *k);
+
 PMOD_EXPORT struct mapping *debug_allocate_mapping(int size);
 
 /** Function that actually frees the mapping data, called by the wrapper