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:
Mike Heffner 2003-02-24 05:56:36 +00:00
parent 1e73455ba1
commit fd1bfb8056
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111414

View file

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