diff --git a/src/server/regex-match.c b/src/server/regex-match.c index 43698cd5c2686fedc79d5185d40292b20e187318..1b42991b07e7609209ad7a49c216a365a9f3b800 100644 --- a/src/server/regex-match.c +++ b/src/server/regex-match.c @@ -1,5 +1,5 @@ /* - * $Id: regex-match.c,v 1.17 1998/07/08 13:42:02 ceder Exp $ + * $Id: regex-match.c,v 1.18 1998/12/20 19:45:04 ceder Exp $ * Copyright (C) 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ */ static const char * -rcsid = "$Id: regex-match.c,v 1.17 1998/07/08 13:42:02 ceder Exp $"; +rcsid = "$Id: regex-match.c,v 1.18 1998/12/20 19:45:04 ceder Exp $"; #include "rcs.h" USE(rcsid); @@ -76,7 +76,11 @@ lookup_regexp (const String regexp, pat_buf.translate = DEFAULT_COLLAT_TAB; pat_buf.translate = NULL; - pat_buf.fastmap = 0; + /* We have to use malloc() instead of smalloc() when allocating + the fastmap, since regfree will use free() to free the memory. + If malloc fails here we simply continue without a fastmap. The + match will be a little slower, but that is not fatal. */ + pat_buf.fastmap = malloc(256); pat_buf.allocated = 0; pat_buf.buffer = 0;