Added special strdup to liboptions, to prevent memory leaks for option strings
If you are doing memory leak debugging you don't want to see any leaks when stopping the program.
This commit is contained in:
@@ -184,7 +184,7 @@ static int handle_options(int short_option, int argi, char **argv)
|
||||
samplerate = atof(argv[argi]);
|
||||
break;
|
||||
case 'w':
|
||||
wave_file = strdup(argv[argi]);
|
||||
wave_file = options_strdup(argv[argi]);
|
||||
break;
|
||||
case 'r':
|
||||
rt_prio = atoi(argv[argi]);
|
||||
@@ -208,7 +208,7 @@ static int handle_options(int short_option, int argi, char **argv)
|
||||
grid_width = atoi(argv[argi]);
|
||||
break;
|
||||
case 'I':
|
||||
station_id = strdup(argv[argi]);
|
||||
station_id = options_strdup(argv[argi]);
|
||||
if (strlen(station_id) != 12) {
|
||||
fprintf(stderr, "Given station ID must be exactly 12 characters long. (Use spaces to fill it.)\n");
|
||||
return -EINVAL;
|
||||
@@ -535,6 +535,8 @@ int main(int argc, char *argv[])
|
||||
/* exits */
|
||||
fm_exit();
|
||||
|
||||
options_free();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user