mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
Windows: cm_GetNewSCache must return NULL on failure
cm_GetNewSCache was leaking a valid cm_scache_t pointer in some failure cases. On failure, explicitly set the return value to NULL. Change-Id: I074b278f969224aa535abe256ac33a90d0f4e62d Reviewed-on: http://gerrit.openafs.org/7037 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
parent
e3a50ea0d3
commit
e1eba14584
@ -339,7 +339,7 @@ cm_GetNewSCache(afs_uint32 locked)
|
||||
*/
|
||||
cm_AdjustScacheLRU(scp);
|
||||
|
||||
/* and we're done */
|
||||
/* and we're done - SUCCESS */
|
||||
osi_assertx(!(scp->flags & CM_SCACHEFLAG_INHASH), "CM_SCACHEFLAG_INHASH set");
|
||||
goto done;
|
||||
}
|
||||
@ -362,6 +362,8 @@ cm_GetNewSCache(afs_uint32 locked)
|
||||
|
||||
osi_Log2(afsd_logp, "GetNewSCache all scache entries in use (attempt = %d, count = %u)", attempt, count);
|
||||
}
|
||||
/* FAILURE */
|
||||
scp = NULL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user