diff options
author | alm <alm@FreeBSD.org> | 1993-08-16 09:30:18 +0000 |
---|---|---|
committer | alm <alm@FreeBSD.org> | 1993-08-16 09:30:18 +0000 |
commit | c05c784bea14ce7b1f64107bb140b0166c4744b1 (patch) | |
tree | 3d7d07feef5bd5d0614e02e0f026fd8437ab8d13 /bin/ed | |
parent | 882c5ab2bda10a72521920aa71d6118484662cc5 (diff) | |
download | FreeBSD-src-c05c784bea14ce7b1f64107bb140b0166c4744b1.zip FreeBSD-src-c05c784bea14ce7b1f64107bb140b0166c4744b1.tar.gz |
Nullify pattern after failed regcomp
Diffstat (limited to 'bin/ed')
-rw-r--r-- | bin/ed/re.c | 3 |
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; } |