diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Changelog for libyaml-streamly
 
+## 0.2.4.0
+
+* Allow ByteString that is the result of serialization to be freed: [https://github.com/snoyberg/yaml/pull/233](https://github.com/snoyberg/yaml/pull/233)
+
 ## 0.2.3.0
 
 * migrate to streamly-core
diff --git a/libyaml-streamly.cabal b/libyaml-streamly.cabal
--- a/libyaml-streamly.cabal
+++ b/libyaml-streamly.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.2
 name:               libyaml-streamly
-version:            0.2.3.0
+version:            0.2.4.0
 synopsis:           Low-level, streaming YAML interface via streamly.
 description:        Rewrite of libyaml in streamly
 category:           Text
diff --git a/src/Text/Libyaml.hs b/src/Text/Libyaml.hs
--- a/src/Text/Libyaml.hs
+++ b/src/Text/Libyaml.hs
@@ -787,7 +787,7 @@
     close _ fbuf = withForeignPtr fbuf $ \b -> do
         ptr' <- c_get_buffer_buff b
         len <- c_get_buffer_used b
-        fptr <- newForeignPtr_ $ castPtr ptr'
+        fptr <- newForeignPtr finalizerFree $ castPtr ptr'
         return $ B.fromForeignPtr fptr 0 $ fromIntegral len
 
 
