clients: Don't leak "menu" on error path in clients/window.c
authorMartin Olsson <martin@minimum.se>
Sun, 8 Jul 2012 01:03:40 +0000 (03:03 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 9 Jul 2012 21:50:44 +0000 (17:50 -0400)
clients/window.c

index 8f3c942..f81d06f 100644 (file)
@@ -3133,8 +3133,10 @@ window_show_menu(struct display *display,
                return;
 
        window = window_create_internal(parent->display, parent, TYPE_MENU);
-       if (!window)
+       if (!window) {
+               free(menu);
                return;
+       }
 
        menu->window = window;
        menu->widget = window_add_widget(menu->window, menu);