Avoid freeing NULL pointer in case of an error.
This commit is contained in:
parent
a5fbf7ac1f
commit
2c965e1956
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169106
@ -1929,7 +1929,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int *eofp, int *ncookies, u_lon
|
||||
|
||||
uio->uio_loffset = offset;
|
||||
ZFS_EXIT(zfsvfs);
|
||||
if (error != 0) {
|
||||
if (error != 0 && *cookies != NULL) {
|
||||
free(*cookies, M_TEMP);
|
||||
*cookies = NULL;
|
||||
*ncookies = 0;
|
||||
|
@ -1929,7 +1929,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int *eofp, int *ncookies, u_lon
|
||||
|
||||
uio->uio_loffset = offset;
|
||||
ZFS_EXIT(zfsvfs);
|
||||
if (error != 0) {
|
||||
if (error != 0 && *cookies != NULL) {
|
||||
free(*cookies, M_TEMP);
|
||||
*cookies = NULL;
|
||||
*ncookies = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user