mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 09:10:42 +01:00
mmkubernetes bugfix: improper use of calloc()
can cause problems under extreme memory shortage - very unlikely credits to LGTM.COM for detecting this
This commit is contained in:
parent
72e069a8a6
commit
1aea234ac7
@ -1508,8 +1508,9 @@ CODESTARTnewActInst
|
||||
pData->cache = caches[i];
|
||||
} else {
|
||||
CHKmalloc(pData->cache = cacheNew(pData));
|
||||
|
||||
CHKmalloc(caches = realloc(caches, (i + 2) * sizeof(struct cache_s *)));
|
||||
struct cache_s **new_caches = realloc(caches, (i + 2) * sizeof(struct cache_s *));
|
||||
CHKmalloc(new_caches);
|
||||
caches = new_caches;
|
||||
caches[i] = pData->cache;
|
||||
caches[i + 1] = NULL;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user