diff --git a/src/input/plugins/CdioParanoiaInputPlugin.cxx b/src/input/plugins/CdioParanoiaInputPlugin.cxx
index 9961ff5d4..dc7de1e0e 100644
--- a/src/input/plugins/CdioParanoiaInputPlugin.cxx
+++ b/src/input/plugins/CdioParanoiaInputPlugin.cxx
@@ -304,7 +304,11 @@ CdioParanoiaInputStream::Read(void *ptr, size_t length)
 			if (s_err) {
 				FormatError(cdio_domain,
 					    "paranoia_read: %s", s_err);
+#if LIBCDIO_VERSION_NUM >= 90
+				cdio_cddap_free_messages(s_err);
+#else
 				free(s_err);
+#endif
 			}
 			if (!rbuf)
 				throw std::runtime_error("paranoia read error");