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

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