From 134fcbd3b2fbb91e4206cceb1de9d1a3a0690ef6 Mon Sep 17 00:00:00 2001 From: IMS root Date: Tue, 19 Jul 2016 18:07:17 +0200 Subject: [PATCH] presence: fix potential double free in shutdown routine --- modules/presence/hash.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/presence/hash.c b/modules/presence/hash.c index 5c302911734..50657e0a4e3 100644 --- a/modules/presence/hash.c +++ b/modules/presence/hash.c @@ -318,9 +318,14 @@ int delete_shtable(shtable_t htable,unsigned int hash_code,subs_t* subs) { found= s->local_cseq +1; ps->next= s->next; - if(s->contact.s!=NULL) + if(s->contact.s!=NULL) { shm_free(s->contact.s); - shm_free(s); + s->contact.s = NULL; + } + if (s) { + shm_free(s); + s = NULL; + } break; } ps= s;