From: Eric Sandeen Date: Fri, 16 Sep 2011 20:49:32 +0000 (-0500) Subject: mke2fs: Do not let -t or -T be specified more than once X-Git-Tag: v1.42-WIP-0925~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f7c3afaef7af307ae9c0fa3648c2e5c61f468b8;p=thirdparty%2Fe2fsprogs.git mke2fs: Do not let -t or -T be specified more than once In addition to not making sense, it causes a memory leak when fs_type gets overwritten. Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 437b4955d..ff5d54bc4 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1445,9 +1445,19 @@ profile_error: super_only = 1; break; case 't': + if (fs_type) { + com_err(program_name, 0, + _("The -t option may only be used once")); + exit(1); + } fs_type = strdup(optarg); break; case 'T': + if (usage_types) { + com_err(program_name, 0, + _("The -T option may only be used once")); + exit(1); + } usage_types = strdup(optarg); break; case 'U':