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
This commit is contained in:
Carsten Haitzler 2017-07-28 21:12:57 +09:00
parent e9ab26ae53
commit b944fc7c9b
1 changed files with 2 additions and 2 deletions

View File

@ -111,14 +111,14 @@ static void
free_buf(Eina_Evlog_Buf *b)
{
if (!b->buf) return;
b->size = 0;
b->top = 0;
# ifdef HAVE_MMAP
munmap(b->buf, b->size);
# else
free(b->buf);
# endif
b->buf = NULL;
b->size = 0;
b->top = 0;
}
static inline void *