]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
venus: fix memory leak
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Tue, 28 Jun 2016 15:48:06 +0000 (12:48 -0300)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 17 Aug 2016 14:49:09 +0000 (10:49 -0400)
The fs getserverprefs command displays preference
ranks for file / volume location server machine
interfaces. In order to get the complete set of
preference ranks, the VIOC_GETSPREFS system call
might have to be called several times. If so, the
memory previously allocated should be released.

Reviewed-on: https://gerrit.openafs.org/12315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d3b8a05d229a80100f40fca4dfdcd820313fcea8)

Change-Id: Iccd9b98aea1c7cf1d63ad20c470baabe09f7a0d7
Reviewed-on: https://gerrit.openafs.org/12340
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/venus/fs.c

index 37b1788769f46f902c6bbb071de164816bc1162d..9bdd1fba15d14d7d82e413c29c8df4f05e4ab966 100644 (file)
@@ -3305,10 +3305,10 @@ GetPrefCmd(struct cmd_syndesc *as, void *arock)
        }
 
        in->offset = out->next_offset;
-    } while (out->next_offset > 0);
-
-    if (blob.out != space)
-       free(blob.out);
+       if (blob.out != space) {
+           free(blob.out);
+       }
+    } while (in->offset > 0);
 
     return 0;
 }