1*2747eff1SEd Schouten /*-
2*2747eff1SEd Schouten * Copyright (c) 2015 Nuxi, https://nuxi.nl/
3*2747eff1SEd Schouten *
4*2747eff1SEd Schouten * Redistribution and use in source and binary forms, with or without
5*2747eff1SEd Schouten * modification, are permitted provided that the following conditions
6*2747eff1SEd Schouten * are met:
7*2747eff1SEd Schouten * 1. Redistributions of source code must retain the above copyright
8*2747eff1SEd Schouten * notice, this list of conditions and the following disclaimer.
9*2747eff1SEd Schouten * 2. Redistributions in binary form must reproduce the above copyright
10*2747eff1SEd Schouten * notice, this list of conditions and the following disclaimer in the
11*2747eff1SEd Schouten * documentation and/or other materials provided with the distribution.
12*2747eff1SEd Schouten *
13*2747eff1SEd Schouten * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*2747eff1SEd Schouten * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*2747eff1SEd Schouten * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*2747eff1SEd Schouten * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*2747eff1SEd Schouten * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*2747eff1SEd Schouten * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*2747eff1SEd Schouten * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*2747eff1SEd Schouten * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*2747eff1SEd Schouten * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*2747eff1SEd Schouten * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*2747eff1SEd Schouten * SUCH DAMAGE.
24*2747eff1SEd Schouten */
25*2747eff1SEd Schouten
26*2747eff1SEd Schouten #include <search.h>
27*2747eff1SEd Schouten #include <stdlib.h>
28*2747eff1SEd Schouten
29*2747eff1SEd Schouten #include "hsearch.h"
30*2747eff1SEd Schouten
31*2747eff1SEd Schouten void
hdestroy_r(struct hsearch_data * htab)32*2747eff1SEd Schouten hdestroy_r(struct hsearch_data *htab)
33*2747eff1SEd Schouten {
34*2747eff1SEd Schouten struct __hsearch *hsearch;
35*2747eff1SEd Schouten
36*2747eff1SEd Schouten /* Free hash table object and its entries. */
37*2747eff1SEd Schouten hsearch = htab->__hsearch;
38*2747eff1SEd Schouten free(hsearch->entries);
39*2747eff1SEd Schouten free(hsearch);
40*2747eff1SEd Schouten }
41