mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
golang: Don't try to free the result of guestfs_last_error.
The return value is a constant string, part of the handle, and it must not be freed by the golang code.
This commit is contained in:
@@ -112,8 +112,8 @@ func (e *GuestfsError) String() string {
|
||||
}
|
||||
|
||||
func get_error_from_handle (g *Guestfs, op string) *GuestfsError {
|
||||
// NB: DO NOT try to free c_errmsg!
|
||||
c_errmsg := C.guestfs_last_error (g.g)
|
||||
defer C.free (unsafe.Pointer (c_errmsg))
|
||||
errmsg := C.GoString (c_errmsg)
|
||||
|
||||
errno := syscall.Errno (C.guestfs_last_errno (g.g))
|
||||
|
||||
Reference in New Issue
Block a user