---
title: "gss_destroy_cred(_:_:)"
framework: GSS
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.1+, macOS 10.7+, visionOS 1.0+]
path: "gss/gss_destroy_cred(_:_:)"
---

# gss_destroy_cred(_:_:)

Purges a credential from memory.

## Declaration

```swift
func gss_destroy_cred(_ min_stat: UnsafeMutablePointer<OM_uint32>, _ cred_handle: UnsafeMutablePointer<gss_cred_id_t?>) -> OM_uint32
```

## Parameters

- `min_stat`: A pointer to the secondary status result that provides additional information in case of failure.
- `cred_handle`: The credential to eliminate from memory.

## Mentioned in

Allocating and Releasing Objects

## Return Value

Return Value A status code set to GSS_S_COMPLETE on success. See Function Status for a description of other status outputs.

## Discussion

Discussion This function actively purges the credential from memory and then calls gss_release_cred(_:_:) to free the memory. This is a more secure option than calling the release function directly.

## See Also

### Allocation and Deallocation

- [GSSCreateCredentialFromUUID(_:)](gss/gsscreatecredentialfromuuid(_:).md)
- [gss_add_cred(_:_:_:_:_:_:_:_:_:_:_:)](gss/gss_add_cred(_:_:_:_:_:_:_:_:_:_:_:).md)
- [gss_set_cred_option(_:_:_:_:)](gss/gss_set_cred_option(_:_:_:_:).md)
- [gss_release_cred(_:_:)](gss/gss_release_cred(_:_:).md)
