Skip to content

Commit 215d680

Browse files
l2dyedsiper
authored andcommitted
output: free C string after use
Signed-off-by: Zero King <[email protected]>
1 parent ea13c02 commit 215d680

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

output/output.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ func FLBPluginUnregister(def unsafe.Pointer) {
6464

6565
func FLBPluginConfigKey(plugin unsafe.Pointer, key string) string {
6666
_key := C.CString(key)
67-
return C.GoString(C.output_get_property(_key, plugin))
67+
value := C.GoString(C.output_get_property(_key, plugin))
68+
C.free(unsafe.Pointer(_key))
69+
return value
6870
}
6971

7072
var contexts []interface{}

0 commit comments

Comments
 (0)