From 619b420903c99e48618db0d2f12085111573f279 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Sat, 6 Aug 2011 23:15:14 -0400 Subject: [PATCH] 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 --- src/volser/vos.c | 2 -- 1 file changed, 2 deletions(-) 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) { -- 2.39.5