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