diff --git a/bob/io/base/main.cpp b/bob/io/base/main.cpp
index 304fb59f3bb937a741a7ce9196080770b3c8a2bc..5764f74f90d8d11eea4f8d7c850dd93231377277 100644
--- a/bob/io/base/main.cpp
+++ b/bob/io/base/main.cpp
@@ -34,6 +34,7 @@ static PyObject* PyBobIo_Extensions(PyObject*) {
   for (auto it=table.begin(); it!=table.end(); ++it) {
     PyObject* pyvalue = make_object(it->second.c_str());
     if (!pyvalue) return 0;
+    auto p_ = make_safe(pyvalue);
     if (PyDict_SetItemString(retval, it->first.c_str(), pyvalue) != 0) {
       return 0;
     }