remove the line ENGINE_free. In this function, the engine is not newed, so there should not be a free here. This line can cause nil pointer dereference when called.

This commit is contained in:
Jiajun Xin
2018-11-20 20:29:59 +08:00
committed by Simon
parent e7dc7b2656
commit 49987bfa9f

View File

@@ -95,7 +95,6 @@ func NewEngineByName(name string) (*Engine, error) {
ret := &Engine{eng}
runtime.SetFinalizer(ret, func(ret *Engine) {
C.ENGINE_finish(ret.engine)
C.ENGINE_free(ret.engine)
})
if 1 != C.ENGINE_init(eng) {
return nil, GetErrors()