diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-06 12:35:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-06 12:35:37 -0400 |
commit | 5927ed8d3324c39fd8aa3d496d119b37b97a1d73 (patch) | |
tree | 60fd91a8aaeaf9406658402537b350f7813563b6 /src/common/util.c | |
parent | 4e3f9c1f3af6292f30799f005f6df8f9c1bc7fee (diff) | |
download | tor-5927ed8d3324c39fd8aa3d496d119b37b97a1d73.tar.gz tor-5927ed8d3324c39fd8aa3d496d119b37b97a1d73.zip |
checkSpace.pl now forbids more identifiers.
The functions it warns about are:
assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc,
strdup, strndup, calloc.
Also, fix a few lingering instances of these in the code. Use other
conventions to indicate _intended_ use of assert and
malloc/realloc/etc.
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index c7dd2a8af7..211ed7f8d2 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -147,7 +147,7 @@ tor_malloc_(size_t size DMALLOC_PARAMS) #ifdef USE_DMALLOC result = dmalloc_malloc(file, line, size, DMALLOC_FUNC_MALLOC, 0, 0); #else - result = malloc(size); + result = raw_malloc(size); #endif if (PREDICT_UNLIKELY(result == NULL)) { @@ -246,7 +246,7 @@ tor_realloc_(void *ptr, size_t size DMALLOC_PARAMS) #ifdef USE_DMALLOC result = dmalloc_realloc(file, line, ptr, size, DMALLOC_FUNC_REALLOC, 0); #else - result = realloc(ptr, size); + result = raw_realloc(ptr, size); #endif if (PREDICT_UNLIKELY(result == NULL)) { @@ -285,7 +285,7 @@ tor_strdup_(const char *s DMALLOC_PARAMS) #ifdef USE_DMALLOC duplicate = dmalloc_strdup(file, line, s, 0); #else - duplicate = strdup(s); + duplicate = raw_strdup(s); #endif if (PREDICT_UNLIKELY(duplicate == NULL)) { /* LCOV_EXCL_START */ |