afs: Free afs_thiscell during shutdown 14/13714/3
authorAndrew Deason <adeason@dson.org>
Mon, 22 Jul 2019 00:21:44 +0000 (19:21 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 23 Aug 2019 03:19:36 +0000 (23:19 -0400)
Currently, afs_thiscell can be allocated (via strdup) during client
startup, but is never freed. Free it in shutdown_cell() to avoid
leaking the memory.

Change-Id: I77954ef35f949c8a638ba15615148ab784f7f48f
Reviewed-on: https://gerrit.openafs.org/13714
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/afs_cell.c

index 10c04f6..29cf64f 100644 (file)
@@ -1119,6 +1119,10 @@ shutdown_cell(void)
        cn = next;
     }
 }
+    if (afs_thiscell) {
+       afs_osi_FreeStr(afs_thiscell);
+       afs_thiscell = NULL;
+    }
 }
 
 /*!