<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/OSSafeReleaseNULL",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@macro@OSSafeReleaseNULL"
  },
  "title" : "OSSafeReleaseNULL"
}
-->

# OSSafeReleaseNULL

Frees memory that you allocated for a named class.

```
#define OSSafeReleaseNULL(inst)
```

## Parameters

`inst`

The object that you want to free. After freeing the memory, the macro sets the value of `inst` to `NULL`.

## Discussion

Use this macro to free memory that you allocated [`OSTypeAlloc`](/documentation/DriverKit/OSTypeAlloc). If `inst` is `NULL`, this macro doesn’t attempt to free the memory.

---

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)