1292767Sed/*- 2292767Sed * Copyright (c) 2015 Nuxi, https://nuxi.nl/ 3292767Sed * 4292767Sed * Redistribution and use in source and binary forms, with or without 5292767Sed * modification, are permitted provided that the following conditions 6292767Sed * are met: 7292767Sed * 1. Redistributions of source code must retain the above copyright 8292767Sed * notice, this list of conditions and the following disclaimer. 9292767Sed * 2. Redistributions in binary form must reproduce the above copyright 10292767Sed * notice, this list of conditions and the following disclaimer in the 11292767Sed * documentation and/or other materials provided with the distribution. 12292767Sed * 13292767Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14292767Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15292767Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16292767Sed * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17292767Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18292767Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19292767Sed * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20292767Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21292767Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22292767Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23292767Sed * SUCH DAMAGE. 24292767Sed */ 25292767Sed 26292767Sed#include <sys/cdefs.h> 27292767Sed__FBSDID("$FreeBSD$"); 28292767Sed 29292767Sed#include <search.h> 30292767Sed#include <stdlib.h> 31292767Sed 32292767Sed#include "hsearch.h" 33292767Sed 34292767Sedvoid 35292767Sedhdestroy_r(struct hsearch_data *htab) 36292767Sed{ 37292767Sed struct __hsearch *hsearch; 38292767Sed 39292767Sed /* Free hash table object and its entries. */ 40292767Sed hsearch = htab->__hsearch; 41292767Sed free(hsearch->entries); 42292767Sed free(hsearch); 43292767Sed} 44