From 9c5df0ae70c3a52c921920f097bb15aca6ceea5f Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Mon, 16 Aug 1993 09:30:18 +0000 Subject: [PATCH] Nullify pattern after failed regcomp --- bin/ed/re.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ed/re.c b/bin/ed/re.c index 3fad099c9437..2bf12219f8d8 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -86,7 +86,8 @@ optpat() patlock = 0; if (n = regcomp(exp, exps, 0)) { regerror(n, exp, errmsg, sizeof errmsg); - return NULL; + free(exp); + return exp = NULL; } return exp; }