// Free releases the secret handle. The underlying secret continues to exist. func (sec Secret) Free() error { sec.log.Println("freeing secret...") cRet := C.virSecretFree(sec.virSecret) ret := int(cRet) if ret == -1 { err := LastError() sec.log.Printf("an error occurred: %v\n", err) return err } sec.log.Println("secret freed") return nil }
func cleanupSecret(secret *Secret) { C.virSecretFree(secret.cptr) }
func (s *VirSecret) Free() error { if result := C.virSecretFree(s.ptr); result != 0 { return errors.New(GetLastError()) } return nil }