aboutsummaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-09 09:53:46 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-09 10:10:37 +0200
commitfac398accd9ef50cab9e89844964389cd48abe86 (patch)
tree0bae75abc6e19ee65089e42cd98a18a18ae9359c /config.def.h
parentcfc447cff743d286b38aa3c686f297305148a202 (diff)
downloadvis-fac398accd9ef50cab9e89844964389cd48abe86.tar.gz
vis-fac398accd9ef50cab9e89844964389cd48abe86.tar.xz
Fix a few memory leaks
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h7
1 files changed, 2 insertions, 5 deletions
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] == '/' ?