ocpasswd: address memory leaks

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2019-06-30 09:28:33 +02:00
parent ee2f5e8c05
commit a1b8d0794a

View File

@@ -430,9 +430,17 @@ int main(int argc, char **argv)
switch(c) {
case 'c':
if (fpasswd) {
fprintf(stderr, "-c option cannot be specified multiple time\n");
exit(1);
}
fpasswd = strdup(optarg);
break;
case 'g':
if (groupname) {
fprintf(stderr, "-g option cannot be specified multiple time\n");
exit(1);
}
groupname = strdup(optarg);
break;
case 'd':