diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-08 03:05:08 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-08 03:05:08 +0000 |
commit | 024c059fae2eb7bab2bc8b50cc7b5afccae34916 (patch) | |
tree | 76be5ae6b61c21e4574fd62ff3ce9bcd7bc4fcbd /src/common/util.c | |
parent | 40f7324eeae8886e76b7b28ad4d175369a3d6fb5 (diff) | |
download | tor-024c059fae2eb7bab2bc8b50cc7b5afccae34916.tar tor-024c059fae2eb7bab2bc8b50cc7b5afccae34916.tar.gz |
Force tor_malloc(0) to always be sane
svn:r1558
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 935aadea9..c5dd6aa97 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -69,6 +69,10 @@ void *tor_malloc(size_t size) { void *result; + /* Some libcs don't do the right thing on size==0. Override them. */ + if (size==0) { + size=1; + } result = malloc(size); if(!result) { |