Fix minor memleak in Go bindings (#241)
* Fix minor memleak in Go bindings * Move fclose back to after nil check * Move it to correct spot, ugh
This commit is contained in:
parent
9a93c75e23
commit
c448e9bfcc
|
@ -91,7 +91,11 @@ func LoadTrustedSetupFile(trustedSetupFile string) CKZGRet {
|
||||||
if loaded {
|
if loaded {
|
||||||
panic("trusted setup is already loaded")
|
panic("trusted setup is already loaded")
|
||||||
}
|
}
|
||||||
fp := C.fopen(C.CString(trustedSetupFile), C.CString("rb"))
|
cTrustedSetupFile := C.CString(trustedSetupFile)
|
||||||
|
defer C.free(unsafe.Pointer(cTrustedSetupFile))
|
||||||
|
cMode := C.CString("r")
|
||||||
|
defer C.free(unsafe.Pointer(cMode))
|
||||||
|
fp := C.fopen(cTrustedSetupFile, cMode)
|
||||||
if fp == nil {
|
if fp == nil {
|
||||||
panic("error reading trusted setup")
|
panic("error reading trusted setup")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue