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
@ -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