summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVuong Hoang <vuonghv.cs@gmail.com>2017-08-05 20:41:37 +0700
committerGitHub <noreply@github.com>2017-08-05 20:41:37 +0700
commit8e9a9bb750504593180591ba927df136252a2532 (patch)
tree730313b23aa6f278073f8f87ca6a2ea16d23418d
parent62b099af00b542bdb08471058d527af258a349cf (diff)
downloadfilo-8e9a9bb750504593180591ba927df136252a2532.tar.gz
filo-8e9a9bb750504593180591ba927df136252a2532.zip
Fix memory leak
Call FIND_RESTORE_HL make a memory leak
-rw-r--r--kilo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kilo.c b/kilo.c
index 9490a77..b54ac8d 100644
--- a/kilo.c
+++ b/kilo.c
@@ -998,6 +998,7 @@ void editorFind(int fd) {
#define FIND_RESTORE_HL do { \
if (saved_hl) { \
memcpy(E.row[saved_hl_line].hl,saved_hl, E.row[saved_hl_line].rsize); \
+ free(saved_hl); \
saved_hl = NULL; \
} \
} while (0)