Skip to content
Permalink
Browse files

free polscript to avoid resource leak

free polscript when irqbalance exit or the same option is passed twice on the comand line
  • Loading branch information
liuchao173 committed Dec 3, 2019
1 parent 3768776 commit 6e4ef7f8a13147c15ac542f829b5a7b6a93ce239
Showing with 2 additions and 2 deletions.
  1. +2 −2 irqbalance.c
@@ -153,6 +153,7 @@ static void parse_command_line(int argc, char **argv)
add_cl_banned_irq((int)val);
break;
case 'l':
free(polscript);
polscript = strdup(optarg);
break;
case 'm':
@@ -702,8 +703,7 @@ int main(int argc, char** argv)
out:
free_object_tree();
free_cl_opts();
if (polscript)
free(polscript);
free(polscript);

/* Remove pidfile */
if (!foreground_mode && pidfile)

0 comments on commit 6e4ef7f

Please sign in to comment.
You can’t perform that action at this time.