fix memory leak issue
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@900 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
3c975d6922
commit
f245caa86c
@ -286,7 +286,8 @@ rt_bool_t nfs_is_directory(struct nfs_filesystem* nfs, const char* name)
|
|||||||
|
|
||||||
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +338,7 @@ int nfs_create(struct nfs_filesystem* nfs, const char *name, mode_t mode)
|
|||||||
}
|
}
|
||||||
xdr_free((xdrproc_t)xdr_CREATE3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_CREATE3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -384,6 +386,8 @@ int nfs_mkdir(struct nfs_filesystem* nfs, const char *name, mode_t mode)
|
|||||||
}
|
}
|
||||||
xdr_free((xdrproc_t)xdr_MKDIR3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_MKDIR3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,6 +708,7 @@ int nfs_open(struct dfs_fd* file)
|
|||||||
|
|
||||||
copy_handle(&fp->handle, handle);
|
copy_handle(&fp->handle, handle);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
if (file->flags & DFS_O_APPEND)
|
if (file->flags & DFS_O_APPEND)
|
||||||
{
|
{
|
||||||
@ -766,6 +771,7 @@ int nfs_stat(struct dfs_filesystem* fs, const char *path, struct _stat *st)
|
|||||||
|
|
||||||
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -790,6 +796,7 @@ nfs_dir *nfs_opendir(struct nfs_filesystem* nfs, const char *path)
|
|||||||
|
|
||||||
copy_handle(&dir->handle, handle);
|
copy_handle(&dir->handle, handle);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
|
|
||||||
dir->cookie=0;
|
dir->cookie=0;
|
||||||
memset(&dir->cookieverf, '\0', sizeof(cookieverf3));
|
memset(&dir->cookieverf, '\0', sizeof(cookieverf3));
|
||||||
@ -884,6 +891,7 @@ int nfs_unlink(struct dfs_filesystem* fs, const char* path)
|
|||||||
}
|
}
|
||||||
xdr_free((xdrproc_t)xdr_REMOVE3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_REMOVE3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -917,6 +925,7 @@ int nfs_unlink(struct dfs_filesystem* fs, const char* path)
|
|||||||
|
|
||||||
xdr_free((xdrproc_t)xdr_RMDIR3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_RMDIR3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
rt_free(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user