diff options
author | Roger Dingledine <arma@torproject.org> | 2003-05-20 06:41:23 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-05-20 06:41:23 +0000 |
commit | 39e9d79038f6075ec59fdafba811ffa406796b5c (patch) | |
tree | efc72733f83deda7f2390c5ed49138441b979421 /src/or/buffers.c | |
parent | 59029a3eedf934407db17b29be77b89d9a12d77e (diff) | |
download | tor-39e9d79038f6075ec59fdafba811ffa406796b5c.tar tor-39e9d79038f6075ec59fdafba811ffa406796b5c.tar.gz |
add circuit-level sendme relay cells
remove sendme cells
replace malloc with tor_malloc
patch (but not track down) bug in onion pending list
streamline connection_ap handshake
svn:r293
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index f0b3e2f6c..ec0022f14 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -10,15 +10,13 @@ extern or_options_t options; /* command-line and config-file options */ /* Create a new buf of size MAX_BUF_SIZE. Write a pointer to it * into *buf, write MAX_BUF_SIZE into *buflen, and initialize - * *buf_datalen to 0. Return 0 if success, or -1 if malloc fails. + * *buf_datalen to 0. Return 0. */ int buf_new(char **buf, int *buflen, int *buf_datalen) { assert(buf && buflen && buf_datalen); - *buf = (char *)malloc(MAX_BUF_SIZE); - if(!*buf) - return -1; + *buf = (char *)tor_malloc(MAX_BUF_SIZE); // memset(*buf,0,MAX_BUF_SIZE); *buflen = MAX_BUF_SIZE; *buf_datalen = 0; @@ -139,9 +137,7 @@ int write_to_buf(char *string, int string_len, z_stream *zstream_new(int compression) { z_stream* stream; - stream = malloc(sizeof(z_stream)); - if (!stream) - return NULL; + stream = tor_malloc(sizeof(z_stream)); memset(stream, 0, sizeof(z_stream)); if (compression) { if (deflateInit(stream, Z_DEFAULT_COMPRESSION) != Z_OK) { |