aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-19 23:48:14 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-19 23:48:14 +0000
commit6b716fdfb96f0dd746c948a8624dc90cec64d0c1 (patch)
treea9df278adbdb798346f5aa2b806f780cd46beae2 /src/common
parent5ebb949c9f8c66c7c38eda65226677acbe148193 (diff)
downloadtor-6b716fdfb96f0dd746c948a8624dc90cec64d0c1.tar.gz
tor-6b716fdfb96f0dd746c948a8624dc90cec64d0c1.zip
NEEDS REVIEW. Act on previous comment, and handle named servers differently: now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate.
svn:r8433
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c7
-rw-r--r--src/common/util.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d4a939b14f..d0f568486c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -204,6 +204,13 @@ _tor_memdup(const void *mem, size_t len DMALLOC_PARAMS)
return dup;
}
+/** Helper for places that need to take a function pointer to the right
+ * spelling of "free()". */
+void
+_tor_free(void *mem) {
+ tor_free(mem);
+}
+
/* =====
* String manipulation
* ===== */
diff --git a/src/common/util.h b/src/common/util.h
index a10e107724..22f4ea3b99 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -75,6 +75,7 @@ char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS)
ATTR_MALLOC ATTR_NONNULL((1));
void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS)
ATTR_MALLOC ATTR_NONNULL((1));
+void _tor_free(void *mem);
#ifdef USE_DMALLOC
extern int dmalloc_free(const char *file, const int line, void *pnt,
const int func_id);