[sr-dev] git:master: modules/sca: fix hash entry deletion

Timo Teras timo.teras at iki.fi
Fri Nov 15 15:36:09 CET 2013


Module: sip-router
Branch: master
Commit: 56e4f4518028e73f9ebd053242a100a5c3b7eb53
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=56e4f4518028e73f9ebd053242a100a5c3b7eb53

Author: Timo Teräs <timo.teras at iki.fi>
Committer: Timo Teräs <timo.teras at iki.fi>
Date:   Fri Nov 15 16:06:25 2013 +0200

modules/sca: fix hash entry deletion

sca_hash_table_slot_kv_delete_unsafe() uses internally sca_hash_entry
but incorrectly called sca_hash_table_slot_kv_find_unsafe() to
initialize the entry. That function returns the node value, not the
node itself. Use instead sca_hash_table_slot_kv_find_entry_unsafe().

Should fix the crash in FS#366.

---

 modules/sca/sca_hash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/sca/sca_hash.c b/modules/sca/sca_hash.c
index 996acd9..a92b6c4 100644
--- a/modules/sca/sca_hash.c
+++ b/modules/sca/sca_hash.c
@@ -264,7 +264,7 @@ sca_hash_table_slot_kv_delete_unsafe( sca_hash_slot *slot, str *key )
 {
     sca_hash_entry	*e;
 
-    e = sca_hash_table_slot_kv_find_unsafe( slot, key );
+    e = sca_hash_table_slot_kv_find_entry_unsafe( slot, key );
     if ( e == NULL ) {
 	return( -1 );
     }




More information about the sr-dev mailing list