diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-10-25 01:28:38 +0400 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-10-25 03:35:54 +0400 |
commit | 433dddcf29d257310e95e4215dceef8b0b976e2d (patch) | |
tree | f94cf9643ab06c99895219635d46cbc73c922682 /os | |
parent | 04a04e162886ca9bc3977d3a7509def876487921 (diff) |
Replace "if(buf) realloc(buf, size) else malloc(size)" with realloc()
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'os')
-rw-r--r-- | os/log.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -305,10 +305,7 @@ LogVWrite(int verb, const char *f, va_list args) if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); + saveBuffer = realloc(saveBuffer, bufferSize); if (!saveBuffer) FatalError("realloc() failed while saving log messages\n"); } |