From a0ec558daa1b8244dd2567d7e29d9497b745271d Mon Sep 17 00:00:00 2001 From: Dong-Yun Lee Date: Thu, 29 Oct 2020 18:11:29 +0900 Subject: [PATCH] Fix a memory leakage in getRowid (#406) --- statement.go | 1 + 1 file changed, 1 insertion(+) diff --git a/statement.go b/statement.go index 33000ea..022622d 100644 --- a/statement.go +++ b/statement.go @@ -673,6 +673,7 @@ func (stmt *Stmt) getRowid() (string, error) { if err != nil { return "", err } + defer C.OCIDescriptorFree(*rowidP, C.OCI_DTYPE_ROWID) // OCI_ATTR_ROWID returns the ROWID descriptor allocated with OCIDescriptorAlloc() _, err = stmt.ociAttrGet(*rowidP, C.OCI_ATTR_ROWID)