summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormikeh <mikeh@FreeBSD.org>2003-02-24 05:56:36 +0000
committermikeh <mikeh@FreeBSD.org>2003-02-24 05:56:36 +0000
commitaeedc1f513c05f477560d0d557b422ec6900caee (patch)
treef5ff0e94bdcf335bbec0c037aa3e0870470c9dac /usr.sbin
parent078fd34f19ff211db9dfb2e8c46dc44394b77526 (diff)
downloadFreeBSD-src-aeedc1f513c05f477560d0d557b422ec6900caee.zip
FreeBSD-src-aeedc1f513c05f477560d0d557b422ec6900caee.tar.gz
Check whether setmode(3) fails and deallocate its return value after
calling getmode(3). Approved by: wollman MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/zic/zic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/zic/zic.c b/usr.sbin/zic/zic.c
index 109b978..5492648 100644
--- a/usr.sbin/zic/zic.c
+++ b/usr.sbin/zic/zic.c
@@ -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':
OpenPOWER on IntegriCloud