From: Simon Wilkinson Date: Sat, 31 Mar 2012 19:27:53 +0000 (-0400) Subject: cmd: Don't leak memory when constructing help string X-Git-Tag: upstream/1.8.0_pre1^2~2585 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bdca02dfe7df3800a3e5f3a9b10ca1d223779ef9;p=packages%2Fo%2Fopenafs.git cmd: Don't leak memory when constructing help string It's not critical, because we'll be exiting soon afterwards, but just to be nice, don't leak the name of every command option whilst we're constructing the help string. Caught by clang-analyzer Change-Id: I87fdb2030c6a7c5ad810f2a06820c08cbe2fb18e Reviewed-on: http://gerrit.openafs.org/7107 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index f5282a377..4389adc8b 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -254,6 +254,7 @@ PrintSyntax(struct cmd_syndesc *as) str, tp->flags & CMD_OPTIONAL?"]":""); free(str); + free(name); len+=xtralen; } printf("\n");