mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 12:49:21 +00:00
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>
This commit is contained in:
5
os/log.c
5
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user