diff options
author | 2009-11-13 17:22:13 +0000 | |
---|---|---|
committer | 2009-11-13 17:22:13 +0000 | |
commit | f4bfdd1a5d7e8e2a92d936fc207cd886d5503526 (patch) | |
tree | 272066153dd8d8992fdc255e8fab4667fd93de0b | |
parent | Use TAILQ_ macros instead of handrolling them self. Tested by myself. (diff) | |
download | wireguard-openbsd-f4bfdd1a5d7e8e2a92d936fc207cd886d5503526.tar.xz wireguard-openbsd-f4bfdd1a5d7e8e2a92d936fc207cd886d5503526.zip |
stop the options string leak if it is not attached into the options
linked list, found by parfait, ok jsg
-rw-r--r-- | bin/pax/options.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c index ce46a493cc4..df51ed57d02 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.72 2009/11/12 20:10:48 deraadt Exp $ */ +/* $OpenBSD: options.c,v 1.73 2009/11/13 17:22:13 deraadt Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -1413,6 +1413,7 @@ opt_add(const char *str) free(dstr); return(-1); } + dstr = NULL; /* parts of string going onto the OPLIST */ *pt++ = '\0'; opt->name = frpt; opt->value = pt; @@ -1428,6 +1429,7 @@ opt_add(const char *str) optail->fow = opt; optail = opt; } + free(dstr); return(0); } |