init: fix missing dlhandle reference put
[fio.git] / init.c
diff --git a/init.c b/init.c
index 03cdf902261f51d6d4dc33360bdcb67bd9fe88c9..f7d79c1c8a210b0eb5530602b881f18178eccffb 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1083,8 +1083,11 @@ int ioengine_load(struct thread_data *td)
                 */
                dlhandle = td->io_ops_dlhandle;
                ops = load_ioengine(td);
-               if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle)
+               if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) {
+                       if (dlhandle)
+                               dlclose(dlhandle);
                        return 0;
+               }
 
                if (dlhandle && dlhandle != td->io_ops_dlhandle)
                        dlclose(dlhandle);