]> git.sur5r.net Git - i3/i3/commitdiff
con_toggle_layout: free(tm_dup) outside loop 3203/head
authorOrestis Floros <orestisf1993@gmail.com>
Sun, 25 Mar 2018 17:48:20 +0000 (20:48 +0300)
committerOrestis Floros <orestisf1993@gmail.com>
Sun, 25 Mar 2018 17:48:20 +0000 (20:48 +0300)
src/con.c

index 480b9e9e9c4fd35fbdb23b0535bb08d9248a6685..8953f0ed0ea0f18e271866942beeb7a786548cf6 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -1917,7 +1917,6 @@ void con_toggle_layout(Con *con, const char *toggle_mode) {
              * now let's activate the current layout (next in list) */
             if (current_layout_found) {
                 new_layout = layout;
-                free(tm_dup);
                 break;
             }
 
@@ -1925,6 +1924,7 @@ void con_toggle_layout(Con *con, const char *toggle_mode) {
                 current_layout_found = true;
             }
         }
+        free(tm_dup);
 
         if (new_layout != L_DEFAULT) {
             con_set_layout(con, new_layout);