summaryrefslogtreecommitdiffstats
path: root/generic/regfree.c
blob: a5c3f0b39a88545366de8f0a542b59ea86acedaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * regfree - free an RE
 *
 * You might think that this could be incorporated into regcomp.c, and
 * that would be a reasonable idea... except that this is a generic
 * function (with a generic name), applicable to all compiled REs
 * regardless of the size of their characters, whereas the stuff in
 * regcomp.c gets compiled once per character size.
 */

#include "regguts.h"

/*
 - regfree - free an RE (generic function, punts to RE-specific function)
 *
 * Ignoring invocation with NULL is a convenience.
 */
VOID
regfree(re)
regex_t *re;
{
	if (re == NULL)
		return;
	(*((struct fns *)re->re_fns)->free)(re);
}