diff options
author | Michael Adam <obnox@samba.org> | 2009-08-04 14:46:54 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-08-04 23:47:27 +0200 |
commit | 25344751eb629e1d646535a4cfe5899e9a35727c (patch) | |
tree | 25cb0a73440f8d02762e3125ada525c4d79a96ba /src/buffer.c | |
parent | ab4df6edb81e5237d8c4b381eae01bb5794e8819 (diff) |
buffer: untangle assignment from check in makenewline().
For better debuggability.
Michael
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 6 |
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; |