From: Garrett Wollman Date: Sun, 7 Aug 2011 03:15:14 +0000 (-0400) Subject: vos: don't free stack garbage on error X-Git-Tag: upstream/1.8.0_pre1^2~3441 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=619b420903c99e48618db0d2f12085111573f279;p=packages%2Fo%2Fopenafs.git vos: don't free stack garbage on error If wantExtendedInfo is true, then pntr is used uninitialized. In the other case, UV_ListVolumes will have set it to NULL before doing anything (even if it returns an error), so this free() is dead anyway. Change-Id: I6979a69d33ecbbdb906eb9a075bbf13180e36646 Found-by: clang static analyzer Reviewed-on: http://gerrit.openafs.org/5164 Tested-by: BuildBot Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- diff --git a/src/volser/vos.c b/src/volser/vos.c index 9f19b271a..c8bd25143 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -3718,8 +3718,6 @@ ListVolumes(struct cmd_syndesc *as, void *arock) &pntr, &count); if (code) { PrintDiagnostics("listvol", code); - if (pntr) - free(pntr); exit(1); } if (wantExtendedInfo) {