summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-28 21:12:57 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-29 09:08:40 +0900
commitb944fc7c9bb4016ed54d440759ae463aec8404ee (patch)
tree8be2bcfe48511cae1f2489a0617bae90fcf1bbc3
parente9ab26ae539db23a06232e6f4fcd757347cbd46e (diff)
eina evlog debugging - when freeing debug buf with mmap 0 size after
munmap would not munmap the memory with a size of 0... so zero the size after the munmap. found by PVS studio @fix
-rw-r--r--src/lib/eina/eina_evlog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c
index dca1e22c32..90af6104a7 100644
--- a/src/lib/eina/eina_evlog.c
+++ b/src/lib/eina/eina_evlog.c
@@ -111,14 +111,14 @@ static void
111free_buf(Eina_Evlog_Buf *b) 111free_buf(Eina_Evlog_Buf *b)
112{ 112{
113 if (!b->buf) return; 113 if (!b->buf) return;
114 b->size = 0;
115 b->top = 0;
116# ifdef HAVE_MMAP 114# ifdef HAVE_MMAP
117 munmap(b->buf, b->size); 115 munmap(b->buf, b->size);
118# else 116# else
119 free(b->buf); 117 free(b->buf);
120# endif 118# endif
121 b->buf = NULL; 119 b->buf = NULL;
120 b->size = 0;
121 b->top = 0;
122} 122}
123 123
124static inline void * 124static inline void *