Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
56e4f45180
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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;
     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 ) {
     if ( e == NULL ) {
 	return( -1 );
 	return( -1 );
     }
     }