]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vos: don't free stack garbage on error
authorGarrett Wollman <wollman@csail.mit.edu>
Sun, 7 Aug 2011 03:15:14 +0000 (23:15 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 12 Aug 2011 15:52:12 +0000 (08:52 -0700)
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.

Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 619b420903c99e48618db0d2f12085111573f279)

Change-Id: Icd76d3ac160ccb04b05445552a9e6d04f053efbb
Reviewed-on: http://gerrit.openafs.org/5227
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/volser/vos.c

index 389e846899afdc49afb6fdd2df49743f5d390255..a48494b2415e91a938d3fbe9ed3e1b464dac441e 100644 (file)
@@ -3736,8 +3736,6 @@ ListVolumes(struct cmd_syndesc *as, void *arock)
                                   &pntr, &count);
            if (code) {
                PrintDiagnostics("listvol", code);
-               if (pntr)
-                   free(pntr);
                exit(1);
            }
            if (wantExtendedInfo) {