mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
Force tor_malloc(0) to always be sane
svn:r1558
This commit is contained in:
parent
40f7324eea
commit
024c059fae
@ -69,6 +69,10 @@
|
|||||||
void *tor_malloc(size_t size) {
|
void *tor_malloc(size_t size) {
|
||||||
void *result;
|
void *result;
|
||||||
|
|
||||||
|
/* Some libcs don't do the right thing on size==0. Override them. */
|
||||||
|
if (size==0) {
|
||||||
|
size=1;
|
||||||
|
}
|
||||||
result = malloc(size);
|
result = malloc(size);
|
||||||
|
|
||||||
if(!result) {
|
if(!result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user