summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>2000-07-08 09:45:17 +0000
committerdcs <dcs@FreeBSD.org>2000-07-08 09:45:17 +0000
commita7a491c8236e9d5f8229ef8095ad50ac81dd66db (patch)
tree66f9a7209664d8f6ad90f71e63d7910a1253f95e /lib/libc/regex
parent1fddde897c979366119f60c016c9d42ef531bbde (diff)
downloadFreeBSD-src-a7a491c8236e9d5f8229ef8095ad50ac81dd66db.zip
FreeBSD-src-a7a491c8236e9d5f8229ef8095ad50ac81dd66db.tar.gz
Since we have modified charjump to be CHAR_MIN-based, we have to
correct the offset when we free it. Caught by: phkmalloc
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regfree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c
index cd6b3dc..4266d1c 100644
--- a/lib/libc/regex/regfree.c
+++ b/lib/libc/regex/regfree.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94";
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <regex.h>
#include "utils.h"
@@ -79,7 +80,7 @@ regex_t *preg;
if (g->must != NULL)
free(g->must);
if (g->charjump != NULL)
- free(g->charjump);
+ free(&g->charjump[CHAR_MIN]);
if (g->matchjump != NULL)
free(g->matchjump);
free((char *)g);
OpenPOWER on IntegriCloud