From: Carsten Haitzler (Rasterman) Date: Fri, 28 Jul 2017 12:12:57 +0000 (+0900) Subject: eina evlog debugging - when freeing debug buf with mmap 0 size after X-Git-Tag: upstream/1.20.0~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b944fc7c9bb4016ed54d440759ae463aec8404ee;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c index dca1e22..90af610 100644 --- a/src/lib/eina/eina_evlog.c +++ b/src/lib/eina/eina_evlog.c @@ -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 *