Clear f_rabuf after freeing the memory it points to. This prevents a
possible double free. Obtained from: Juniper Networks, Inc.
This commit is contained in:
parent
157a2d49a0
commit
983d2efd20
@ -75,8 +75,10 @@ close(int fd)
|
||||
errno = EBADF;
|
||||
return (-1);
|
||||
}
|
||||
if (f->f_rabuf != NULL)
|
||||
if (f->f_rabuf != NULL) {
|
||||
free(f->f_rabuf);
|
||||
f->f_rabuf = NULL;
|
||||
}
|
||||
if (!(f->f_flags & F_RAW) && f->f_ops)
|
||||
err1 = (f->f_ops->fo_close)(f);
|
||||
if (!(f->f_flags & F_NODEV) && f->f_dev)
|
||||
|
Loading…
Reference in New Issue
Block a user