Skip to content

Commit

Permalink
fix(go): memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Feb 25, 2024
1 parent 543a2a6 commit 262ccdf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (r *Rules) Serialize() ([]byte, error) {
if C.yrx_rules_serialize(r.cRules, &buf) != C.SUCCESS {
return nil, errors.New(C.GoString(C.yrx_last_error()))
}
defer C.yrx_buffer_destroy(buf)
runtime.KeepAlive(r)
return C.GoBytes(unsafe.Pointer(buf.data), C.int(buf.length)), nil
}
Expand Down

0 comments on commit 262ccdf

Please sign in to comment.