diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-11-12 16:25:23 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-11-12 16:25:23 +0000 |
commit | b9152dfa08f50e6b6793011744d88f1de2bed569 (patch) | |
tree | e51ac590686ecc5a9e946ddab17b8de3ef492e1d /sbin/dump | |
parent | 5f5b8b2e9032662fc90722be2bf3cebb0959f7d2 (diff) |
free flagsp if flags variable indicates it was not used, found by parfait; ok millert
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 202d1015d22..140026e463d 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.43 2009/10/27 23:59:32 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.44 2009/11/12 16:25:22 deraadt Exp $ */ /* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */ /*- @@ -677,11 +677,12 @@ obsolete(int *argcp, char **argvp[]) } } - /* Terminate flags. */ + /* Terminate flags, or toss the buffer we did not use. */ if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++)) |