opt_background = 1;
break;
case 'g':
+ /*
+ * If the override option is set, the pointer points to a
+ * *non* const thus freeing it even though the variable type is
+ * set to const.
+ */
+ if (tracing_group_name_override) {
+ free((void *) tracing_group_name);
+ }
tracing_group_name = strdup(arg);
if (!tracing_group_name) {
perror("strdup");
ret = -ENOMEM;
}
+ tracing_group_name_override = 1;
break;
case 'h':
usage();
}
break;
case 'u':
+ if (consumerd32_bin_override) {
+ free((void *) consumerd32_bin);
+ }
consumerd32_bin = strdup(arg);
if (!consumerd32_bin) {
perror("strdup");
consumerd32_bin_override = 1;
break;
case 'U':
+ if (consumerd32_libdir_override) {
+ free((void *) consumerd32_libdir);
+ }
consumerd32_libdir = strdup(arg);
if (!consumerd32_libdir) {
perror("strdup");
consumerd32_libdir_override = 1;
break;
case 't':
+ if (consumerd64_bin_override) {
+ free((void *) consumerd64_bin);
+ }
consumerd64_bin = strdup(arg);
if (!consumerd64_bin) {
perror("strdup");
consumerd64_bin_override = 1;
break;
case 'T':
+ if (consumerd64_libdir_override) {
+ free((void *) consumerd64_libdir);
+ }
consumerd64_libdir = strdup(arg);
if (!consumerd64_libdir) {
perror("strdup");
consumerd64_libdir_override = 1;
break;
case 'p':
+ free(opt_pidfile);
opt_pidfile = strdup(arg);
if (!opt_pidfile) {
perror("strdup");
break;
}
case 'l':
+ free(opt_load_session_path);
opt_load_session_path = strdup(arg);
if (!opt_load_session_path) {
perror("strdup");
}
break;
case 'P': /* probe modules list */
+ free(kmod_probes_list);
kmod_probes_list = strdup(arg);
if (!kmod_probes_list) {
perror("strdup");