mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 09:10:42 +01:00
mmkubernetes bugfix: improper use of calloc()
could cause problems under extreme memory shortage - very unlikely credits to LGTM.COM for detecting this
This commit is contained in:
parent
716f4136e8
commit
b4e625f074
@ -952,8 +952,9 @@ growCompressCtx(wrkrInstanceData_t *pWrkrData, size_t newLen)
|
||||
if (pWrkrData->compressCtx.buf == NULL) {
|
||||
CHKmalloc(pWrkrData->compressCtx.buf = (uchar *)malloc(sizeof(uchar)*newLen));
|
||||
} else {
|
||||
CHKmalloc(pWrkrData->compressCtx.buf = (uchar *)realloc(pWrkrData->compressCtx.buf,
|
||||
sizeof(uchar)*newLen));
|
||||
uchar *const newbuf = (uchar *)realloc(pWrkrData->compressCtx.buf, sizeof(uchar)*newLen);
|
||||
CHKmalloc(newbuf);
|
||||
pWrkrData->compressCtx.buf = newbuf;
|
||||
}
|
||||
pWrkrData->compressCtx.len = newLen;
|
||||
finalize_it:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user