From: Simon Wilkinson Date: Tue, 26 Feb 2013 20:51:34 +0000 (+0000) Subject: afsmonitor: Check correct variable is non-NULL X-Git-Tag: upstream/1.6.10_pre1^2~175 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=588252806a478e36e59a6dfdb2c470eff6c3e25a;p=packages%2Fo%2Fopenafs.git afsmonitor: Check correct variable is non-NULL Before freeing curr_fsData, check that it is non-NULL, rather than checking prev_fsData in error. Caught by coverity (#985289) Reviewed-on: http://gerrit.openafs.org/9284 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit 5a61e826fa0de6a5987f06257199476f79d2473a) Change-Id: Ie63e90f8873f4fbe8afc7abee160a090920add4d Reviewed-on: http://gerrit.openafs.org/11015 Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Stephan Wiesand --- diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index feb177d77..a1e4904e4 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -491,7 +491,7 @@ afsmon_Exit(int a_exitVal) /* exit code */ fprintf(debugFD, ", prev \n"); free(prev_fsData); } - if (prev_cmData != (struct cm_Display_Data *)0) { + if (curr_cmData != (struct cm_Display_Data *)0) { if (afsmon_debug) fprintf(debugFD, "Deallocating CM Print Buffers .... curr"); free(curr_cmData);