projects
/
visor
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fixed: tried to free mapped buffer, unmap if mapped, free otherwise,
[visor]
/
libvisor
/
src
/
visor.c
diff --git
a/libvisor/src/visor.c
b/libvisor/src/visor.c
index
86d508b
..
2c93521
100644
(file)
--- a/
libvisor/src/visor.c
+++ b/
libvisor/src/visor.c
@@
-215,8
+215,16
@@
int vi_delete_buf(struct visor *vi, struct vi_buffer *vb)
return -1;
}
+ if(vb->fp) {
+ if(vb->file_mapped) {
+ vi_unmap(vb->fp);
+ } else {
+ vi_free(vb->orig);
+ }
+ vi_close(vb->fp);
+ }
+
vi_free(vb->path);
- vi_free(vb->orig);
vi_free(vb->add);
vi_free(vb->spans);
return 0;