Browse Source

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.
Timo Teräs 12 năm trước cách đây
mục cha
commit
56e4f45180
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/sca/sca_hash.c

+ 1 - 1
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 );
     }