summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authoralm <alm@FreeBSD.org>1993-08-16 09:30:18 +0000
committeralm <alm@FreeBSD.org>1993-08-16 09:30:18 +0000
commitc05c784bea14ce7b1f64107bb140b0166c4744b1 (patch)
tree3d7d07feef5bd5d0614e02e0f026fd8437ab8d13 /bin
parent882c5ab2bda10a72521920aa71d6118484662cc5 (diff)
downloadFreeBSD-src-c05c784bea14ce7b1f64107bb140b0166c4744b1.zip
FreeBSD-src-c05c784bea14ce7b1f64107bb140b0166c4744b1.tar.gz
Nullify pattern after failed regcomp
Diffstat (limited to 'bin')
-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 3fad099..2bf1221 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;
}
OpenPOWER on IntegriCloud