mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
Check whether setmode(3) fails and deallocate its return value after
calling getmode(3). Approved by: wollman MFC after: 1 week
This commit is contained in:
parent
1e73455ba1
commit
fd1bfb8056
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111414
|
@ -500,7 +500,11 @@ _("more than one -l option specified"));
|
|||
case 'm':
|
||||
{
|
||||
void *set = setmode(optarg);
|
||||
if (set == NULL)
|
||||
errx(EXIT_FAILURE,
|
||||
_("invalid file mode"));
|
||||
getmode(set, mflag);
|
||||
free(set);
|
||||
break;
|
||||
}
|
||||
case 'p':
|
||||
|
|
Loading…
Reference in a new issue