summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-07-02 10:46:46 +0200
committerGitHub <noreply@github.com>2020-07-02 10:46:46 +0200
commit5375e13141b733d5213440f396342729889c22ba (patch)
treedba4b57be2dfaca6771f319cc53015ab8eb8d3fd
parentf12546b4f3dc8a4b84fbba3f2e06a02a9322ccc0 (diff)
parent8e9a9bb750504593180591ba927df136252a2532 (diff)
downloadfilo-5375e13141b733d5213440f396342729889c22ba.tar.gz
filo-5375e13141b733d5213440f396342729889c22ba.zip
Merge pull request #52 from vuonghv/master
Fix memory leak
-rw-r--r--kilo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kilo.c b/kilo.c
index 5405e45..5478305 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)