1f1cdbd3Yuri Pankov/*
2f1cdbd3Yuri Pankov * This file and its contents are supplied under the terms of the
3f1cdbd3Yuri Pankov * Common Development and Distribution License ("CDDL"), version 1.0.
4f1cdbd3Yuri Pankov * You may only use this file in accordance with the terms of version
5f1cdbd3Yuri Pankov * 1.0 of the CDDL.
6f1cdbd3Yuri Pankov *
7f1cdbd3Yuri Pankov * A full copy of the text of the CDDL should have accompanied this
8f1cdbd3Yuri Pankov * source.  A copy of the CDDL is also available via the Internet at
9f1cdbd3Yuri Pankov * http://www.illumos.org/license/CDDL.
10f1cdbd3Yuri Pankov */
11f1cdbd3Yuri Pankov
12f1cdbd3Yuri Pankov/*
13f1cdbd3Yuri Pankov * Copyright 2017 Nexenta Systems, Inc.
14f1cdbd3Yuri Pankov */
15f1cdbd3Yuri Pankov
16f1cdbd3Yuri Pankov#include <stdlib.h>
17f1cdbd3Yuri Pankov#include <strings.h>
18f1cdbd3Yuri Pankov
19f1cdbd3Yuri Pankovvoid
20f1cdbd3Yuri Pankovfreezero(void *ptr, size_t size)
21f1cdbd3Yuri Pankov{
22f1cdbd3Yuri Pankov	if (ptr == NULL)
23f1cdbd3Yuri Pankov		return;
24f1cdbd3Yuri Pankov
25f1cdbd3Yuri Pankov	explicit_bzero(ptr, size);
26f1cdbd3Yuri Pankov	free(ptr);
27f1cdbd3Yuri Pankov}
28