Skip to content

Commit

Permalink
make sure mem_lock exists before calling shm_free
Browse files Browse the repository at this point in the history
Fixes coverity tag 150514
  • Loading branch information
razvancrainea committed Oct 21, 2016
1 parent 2655631 commit 0c88ac7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mem/shm_mem.c
Expand Up @@ -531,15 +531,15 @@ void shm_mem_destroy(void)
if (mem_lock){
LM_DBG("destroying the shared memory lock\n");
lock_destroy(mem_lock); /* we don't need to dealloc it*/
}
#ifdef STATISTICS
if (event_shm_threshold) {
if (event_shm_last)
shm_free(event_shm_last);
if (event_shm_pending)
shm_free(event_shm_pending);
}
if (event_shm_threshold) {
if (event_shm_last)
shm_free(event_shm_last);
if (event_shm_pending)
shm_free(event_shm_pending);
}
#endif
}
if (shm_mempool && (shm_mempool!=(void*)-1)) {
#ifdef SHM_MMAP
munmap(shm_mempool, /* SHM_MEM_SIZE */ shm_mem_size );
Expand Down

0 comments on commit 0c88ac7

Please sign in to comment.