mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 01:01:06 +00:00
sdiff(1): Fix potential NULL deref in cleanup path
In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be NULL. Only fclose() it if it was initialized. Reported by: Coverity CID: 1355183 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
51702162cc
commit
a60711fd00
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299385
|
@ -430,7 +430,8 @@ main(int argc, char **argv)
|
|||
/* Close open files and pipe, delete temps */
|
||||
fclose(file1);
|
||||
fclose(file2);
|
||||
fclose(diffpipe);
|
||||
if (diffpipe != NULL)
|
||||
fclose(diffpipe);
|
||||
if (tmp1)
|
||||
if (unlink(tmp1))
|
||||
warn("Error deleting %s.", tmp1);
|
||||
|
|
Loading…
Reference in a new issue