1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Minor command-line args memory leak

Free previous ones if string arguments (log_filename and initstring) are
given multiple times
This commit is contained in:
Nick Patavalis
2018-02-08 15:38:47 +02:00
parent ed451a1d3a
commit 9d5cc80c47

View File

@ -1867,9 +1867,11 @@ parse_args(int argc, char *argv[])
}
break;
case 'g':
if ( opts.log_filename ) free(opts.log_filename);
opts.log_filename = strdup(optarg);
break;
case 't':
if ( opts.initstring ) free(opts.initstring);
opts.initstring = strdup(optarg);
break;
case 1: