mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 08:20:16 +00:00
dir: Don't leak a buffer on a failed Enumerate
If, for some reasons, Enumerate encounters a hash object with a NULL buffer pointer, that's no reason to leak the hash object. Make sure that we DRelease it before failing Change-Id: I9ba6c69ca524937a6068d33a0ec0a90eef5b88ea Reviewed-on: http://gerrit.openafs.org/5659 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
a9924ba433
commit
3f938315ad
@ -433,8 +433,10 @@ afs_dir_EnumerateDir(dir_file_t dir, int (*proc) (void *, char *name,
|
||||
goto out;
|
||||
|
||||
ep = (struct DirEntry *)entrybuf.data;
|
||||
if (!ep)
|
||||
if (!ep) {
|
||||
DRelease(&entrybuf, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
num = ntohs(ep->next);
|
||||
code = (*proc) (hook, ep->name, ntohl(ep->fid.vnode),
|
||||
|
Loading…
Reference in New Issue
Block a user