]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afsmonitor: Check correct variable is non-NULL
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 26 Feb 2013 20:51:34 +0000 (20:51 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:14:04 +0000 (12:14 -0400)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 5a61e826fa0de6a5987f06257199476f79d2473a)

Change-Id: Ie63e90f8873f4fbe8afc7abee160a090920add4d
Reviewed-on: http://gerrit.openafs.org/11015
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afsmonitor/afsmonitor.c

index feb177d77bc26b62078682e723f3d17c5c93ad24..a1e4904e4e7692ab73b7800ae5611bec317bccb4 100644 (file)
@@ -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);