---
title: IOSafeDeleteNULL
framework: driverkit
role: symbol
role_heading: Macro
path: driverkit/iosafedeletenull
---

# IOSafeDeleteNULL

Frees the memory associated with a typed array.

## Declaration

```occ
#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

Discussion Use this macro to free memory that you allocated with IONew or IONewZero. If ptr is NULL, this macro doesn’t attempt to free the memory.

## See Also

### Deallocation

- [IODelete](driverkit/iodelete.md)
- [OSSafeReleaseNULL](driverkit/ossafereleasenull.md)
- [IOFree](driverkit/iofree.md)
