mirror of
https://git.openafs.org/openafs.git
synced 2025-01-20 07:51:00 +00:00
Windows: Fix usage of cm_FreeServerList
cm_FreeServerList will set the input variable to NULL if the contents of the list could in fact be freed. If they could not be freed, the individual entries are marked for deletion and will not be subsequently used. Do not set the list variable to NULL after calling cm_FreeServerList otherwise memory can be leaked. LICENSE MIT Change-Id: Ia3cacd760d7395a2dd6b063643a8aa86f9e468b9 Reviewed-on: http://gerrit.openafs.org/2078 Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
64e08dca0b
commit
a546f1cd58
@ -94,15 +94,13 @@ cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
|
||||
((cp->flags & CM_CELLFLAG_VLSERVER_INVALID)))
|
||||
)
|
||||
{
|
||||
/* must empty cp->vlServersp */
|
||||
if (cp->vlServersp) {
|
||||
cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
|
||||
cp->vlServersp = NULL;
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&cp->mx);
|
||||
mxheld = 0;
|
||||
|
||||
/* must empty cp->vlServersp */
|
||||
if (cp->vlServersp)
|
||||
cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
|
||||
|
||||
rock.cellp = cp;
|
||||
rock.flags = flags;
|
||||
code = cm_SearchCellRegistry(1, cp->name, NULL, cp->linkedName, cm_AddCellProc, &rock);
|
||||
|
@ -406,7 +406,6 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
lock_ReleaseWrite(&cm_serverLock);
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
@ -508,7 +507,6 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
@ -608,7 +606,6 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
/* Free the server list before cm_ForceUpdateVolume is called */
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
|
@ -1486,7 +1486,6 @@ cm_IoctlNewCell(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
|
||||
/* delete all previous server lists - cm_FreeServerList will ask for write on cm_ServerLock*/
|
||||
cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
|
||||
cp->vlServersp = NULL;
|
||||
lock_ReleaseWrite(&cm_cellLock);
|
||||
|
||||
rock.cellp = cp;
|
||||
|
Loading…
Reference in New Issue
Block a user