aboutsummaryrefslogtreecommitdiff
path: root/bin/ed
diff options
context:
space:
mode:
authorAndrew Moore <alm@FreeBSD.org>1993-08-16 09:30:18 +0000
committerAndrew Moore <alm@FreeBSD.org>1993-08-16 09:30:18 +0000
commit9c5df0ae70c3a52c921920f097bb15aca6ceea5f (patch)
tree3d7d07feef5bd5d0614e02e0f026fd8437ab8d13 /bin/ed
parent8bb722a39001e9f824608c589b0381c014452c8b (diff)
downloadsrc-9c5df0ae70c3a52c921920f097bb15aca6ceea5f.tar.gz
src-9c5df0ae70c3a52c921920f097bb15aca6ceea5f.zip
Nullify pattern after failed regcomp
Notes
Notes: svn path=/head/; revision=293
Diffstat (limited to 'bin/ed')
-rw-r--r--bin/ed/re.c3
1 files changed, 2 insertions, 1 deletions
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;
}