fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro that
references sp. The free needs to follow ISSET PR: 7148 Reviewed by: phk Submitted by: Ken Mayer <kmayer@freegate.com>
This commit is contained in:
parent
e25169f239
commit
8a507b98ab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37349
@ -241,14 +241,15 @@ fts_close(sp)
|
||||
(void)close(sp->fts_rfd);
|
||||
}
|
||||
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
|
||||
/* Set errno and return. */
|
||||
if (!ISSET(FTS_NOCHDIR) && saved_errno) {
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
errno = saved_errno;
|
||||
return (-1);
|
||||
}
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -241,14 +241,15 @@ fts_close(sp)
|
||||
(void)close(sp->fts_rfd);
|
||||
}
|
||||
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
|
||||
/* Set errno and return. */
|
||||
if (!ISSET(FTS_NOCHDIR) && saved_errno) {
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
errno = saved_errno;
|
||||
return (-1);
|
||||
}
|
||||
/* Free up the stream pointer. */
|
||||
free(sp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user