mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
afs: fix memory leak
An error code is returned by afs_ProcessOpCreate if this function can not allocate memory for ttargetName. This function should release the memory previously allocated for tname and decrement the reference count of tdp as well. Change-Id: Ic771b1d57080df6ee562a7327762030afdd5b08c Reviewed-on: https://gerrit.openafs.org/12208 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
2a68f7a1c3
commit
bc12357353
@ -702,7 +702,8 @@ afs_ProcessOpCreate(struct vcache *avc, struct vrequest *areq,
|
|||||||
ttargetName = afs_osi_Alloc(tlen);
|
ttargetName = afs_osi_Alloc(tlen);
|
||||||
if (!ttargetName) {
|
if (!ttargetName) {
|
||||||
afs_PutDCache(tdc);
|
afs_PutDCache(tdc);
|
||||||
return ENOMEM;
|
code = ENOMEM;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
ObtainReadLock(&tdc->lock);
|
ObtainReadLock(&tdc->lock);
|
||||||
tfile = afs_CFileOpen(&tdc->f.inode);
|
tfile = afs_CFileOpen(&tdc->f.inode);
|
||||||
|
Loading…
Reference in New Issue
Block a user