2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 09:31:51 +00:00

[nfs] Fix an invalid free() when loading a regular (non-symlink) file

An invalid free() was ironically introduced by fixing another invalid
free in commit 7aa69c4 ("[nfs] Fix an invalid free() when loading a
symlink").

Signed-off-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Marin Hannache 2014-05-15 19:05:48 +02:00 committed by Michael Brown
parent f747a00c54
commit ca93505a78

View File

@ -145,7 +145,7 @@ static void nfs_done ( struct nfs_request *nfs, int rc ) {
DBGC ( nfs, "NFS_OPEN %p completed (%s)\n", nfs, strerror ( rc ) );
free ( nfs->filename );
free ( nfs->filename - nfs->filename_offset );
intf_shutdown ( &nfs->xfer, rc );
intf_shutdown ( &nfs->pm_intf, rc );
@ -327,8 +327,9 @@ static int nfs_mount_deliver ( struct nfs_request *nfs,
goto err;
sep = strrchr ( nfs->mountpoint, '/' );
nfs->filename[-1] = '/';
nfs->filename = sep + 1;
nfs->filename[-1] = '/';
nfs->filename_offset = sep + 1 - nfs->filename;
nfs->filename = sep + 1;
*sep = '\0';
DBGC ( nfs, "NFS_OPEN %p ENOTDIR received retrying" \