summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-01 18:22:22 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-01 18:22:22 +0000
commitcc3a7c5f72e6ff37ec8a8be4ae6ffd983c15e6b2 (patch)
treea358cb6bb1749d7de857b8a40b04cdc2f3da8b1e
parent127a655f49c0a422a78a259ed8c88e61e8c3de5f (diff)
downloadtor-cc3a7c5f72e6ff37ec8a8be4ae6ffd983c15e6b2.tar.gz
tor-cc3a7c5f72e6ff37ec8a8be4ae6ffd983c15e6b2.zip
Backport 8499: remove dangerous free(0) on hashtable init
svn:r8564
-rw-r--r--ChangeLog5
-rw-r--r--src/common/ht.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1eaa47b12e..cb074aee3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@ Changes in version 0.1.1.25 - 2006-10-?? [ongoing]
and we have a cached answer, give them the cached answer.
Previously, we would give them no answer at all.
+ o Minor bugfixes:
+ - Avoid a memory corruption bug when creating a hash table for the first
+ time.
+
+
Changes in version 0.1.1.24 - 2006-09-29
o Major bugfixes:
diff --git a/src/common/ht.h b/src/common/ht.h
index dd90f2e4fd..63c873f3e6 100644
--- a/src/common/ht.h
+++ b/src/common/ht.h
@@ -379,7 +379,8 @@ ht_string_hash(const char *s)
elm = next; \
} \
} \
- freefn(head->hth_table); \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
head->hth_table = new_table; \
} else { \
unsigned b, b2; \