buffer: untangle assignment from check in makenewline().

For better debuggability.

Michael
This commit is contained in:
Michael Adam 2009-08-04 14:46:54 +02:00
parent ab4df6edb8
commit 25344751eb

View File

@ -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;