<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GSS",
  "identifier" : "/documentation/GSS/gss_destroy_cred(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@gss_destroy_cred"
  },
  "title" : "gss_destroy_cred(_:_:)"
}
-->

# gss_destroy_cred(_:_:)

Purges a credential from memory.

```
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.

## Return Value

A status code set to [`GSS_S_COMPLETE`](/documentation/GSS/GSS_S_COMPLETE) on success. See [Function Status](/documentation/GSS/function-status) for a description of other status outputs.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)