lib/hcrypto: ENGINE_by_dso do not leak handle

Must dlclose(handle) before returning even if 'engine' is
returned to caller.

Change-Id: I169044a768934e9b7774a323fe6c855fd07a09e4
This commit is contained in:
Jeffrey Altman
2022-01-15 23:21:11 -05:00
committed by Jeffrey Altman
parent 440ea95b56
commit 3707c52ea7

View File

@@ -349,12 +349,12 @@ ENGINE_by_dso(const char *path, const char *id)
return NULL;
}
}
dlclose(handle);
ENGINE_up_ref(engine);
ret = add_engine(engine);
if (ret != 1) {
dlclose(handle);
ENGINE_finish(engine);
return NULL;
}