summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-08-04 14:46:54 +0200
committerMichael Adam <obnox@samba.org>2009-08-04 23:47:27 +0200
commit25344751eb629e1d646535a4cfe5899e9a35727c (patch)
tree25cb0a73440f8d02762e3125ada525c4d79a96ba
parentab4df6edb81e5237d8c4b381eae01bb5794e8819 (diff)
downloadtinyproxy-25344751eb629e1d646535a4cfe5899e9a35727c.tar.gz
tinyproxy-25344751eb629e1d646535a4cfe5899e9a35727c.zip
buffer: untangle assignment from check in makenewline().
For better debuggability. Michael
-rw-r--r--src/buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4df30aa..853fb86 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -66,10 +66,12 @@ makenewline (unsigned char *data, size_t length)
assert (data != NULL);
assert (length > 0);
- if (!(newline = safemalloc (sizeof (struct bufline_s))))
+ newline = safemalloc (sizeof (struct bufline_s));
+ if (!newline)
return NULL;
- if (!(newline->string = safemalloc (length)))
+ newline->string = safemalloc (length);
+ if (!newline->string)
{
safefree (newline);
return NULL;