From fac398accd9ef50cab9e89844964389cd48abe86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 9 Sep 2014 09:53:46 +0200 Subject: Fix a few memory leaks --- config.def.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index f1f8d17..ec8e141 100644 --- a/config.def.h +++ b/config.def.h @@ -277,8 +277,7 @@ static void statusbar(WINDOW *win, bool active, const char *filename, size_t lin } static void quit(const Arg *arg) { - endwin(); - exit(0); + vis->running = false; } static void split(const Arg *arg) { @@ -509,9 +508,7 @@ static void prompt_enter(const Arg *arg) { switch (vis->prompt->title[0]) { case '/': case '?': - text_regex_free(vis->search_pattern); - if (!(vis->search_pattern = text_regex_new()) || - text_regex_compile(vis->search_pattern, s, REG_EXTENDED)) { + if (text_regex_compile(vis->search_pattern, s, REG_EXTENDED)) { action_reset(&action); } else { movement(&(const Arg){ .i = vis->prompt->title[0] == '/' ? -- cgit v1.2.3