]> git.sur5r.net Git - i3/i3/blobdiff - i3-input/main.c
fix some memory leaks when user passes command line arguments twice (Thanks Tiago)
[i3/i3] / i3-input / main.c
index 1010e584c15b924c13a2873ddedd3924b13726d1..6c2b35a193f76149a5c1645a38815fae923889e0 100644 (file)
@@ -261,21 +261,25 @@ int main(int argc, char *argv[]) {
         while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
                 switch (o) {
                         case 's':
+                                FREE(socket_path);
                                 socket_path = strdup(optarg);
                                 break;
                         case 'v':
                                 printf("i3-input " I3_VERSION);
                                 return 0;
                         case 'p':
+                                FREE(command_prefix);
                                 command_prefix = strdup(optarg);
                                 break;
                         case 'l':
                                 limit = atoi(optarg);
                                 break;
                         case 'P':
+                                FREE(prompt);
                                 prompt = strdup(optarg);
                                 break;
                         case 'f':
+                                FREE(pattern);
                                 pattern = strdup(optarg);
                                 break;
                         case 'h':