summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-10-25 01:28:38 +0400
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-10-25 03:35:54 +0400
commit433dddcf29d257310e95e4215dceef8b0b976e2d (patch)
treef94cf9643ab06c99895219635d46cbc73c922682 /os
parent04a04e162886ca9bc3977d3a7509def876487921 (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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/os/log.c b/os/log.c
index 3435da6f0..d18f9b3aa 100644
--- a/os/log.c
+++ b/os/log.c
@@ -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");
}