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

# IOSafeDeleteNULL

Frees the memory associated with a typed array.

```
#define IOSafeDeleteNULL(ptr, type, count)
```

## Parameters

`ptr`

The pointer to the memory block to free. You may specify `NULL` for this parameter. After freeing the memory, the macro sets the value of `ptr` to `NULL`.

`type`

The data type stored in the memory block. The macro uses the type to determine its size.

`count`

The number of array entries in the memory block

## Discussion

Use this macro to free memory that you allocated with [`IONew`](/documentation/DriverKit/IONew) or [`IONewZero`](/documentation/DriverKit/IONewZero). If `ptr` 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)