From 433dddcf29d257310e95e4215dceef8b0b976e2d Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Mon, 25 Oct 2010 01:28:38 +0400 Subject: [PATCH] Replace "if(buf) realloc(buf, size) else malloc(size)" with realloc() Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- os/log.c | 5 +---- 1 file changed, 1 insertion(+), 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"); }