summaryrefslogtreecommitdiff
path: root/sys/dev/systrace.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-07-23 18:01:40 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-07-23 18:01:40 +0000
commit54c2357e9a339a6bed2216a269d5e948a126af2b (patch)
tree4b78d20b295e2bdfd9af6502203712ef32ed9d5d /sys/dev/systrace.c
parenteb0a66dbc5ebbb2ad361efd866b9066862b9b1c0 (diff)
prevent double free in some error conditions; from xs@kittenz.org
Diffstat (limited to 'sys/dev/systrace.c')
-rw-r--r--sys/dev/systrace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c
index f3b964f0661..f407e2d8da7 100644
--- a/sys/dev/systrace.c
+++ b/sys/dev/systrace.c
@@ -1048,8 +1048,10 @@ systrace_preprepl(struct str_process *strp, struct systrace_replace *repl)
if (ret)
return (ret);
- if (strp->replace != NULL)
+ if (strp->replace != NULL) {
free(strp->replace, M_XDATA);
+ strp->replace = NULL;
+ }
if (repl->strr_nrepl < 0 || repl->strr_nrepl > SYSTR_MAXARGS)
return (EINVAL);