mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
Don't shrink a talloc area if we have less than 1k to gain
(This used to be commit 0c829e6ee6f43299cc5889c2af3d0402256da0d0)
This commit is contained in:
parent
b4c81c0c18
commit
44cb6a81f2
@ -787,6 +787,11 @@ void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n
|
||||
|
||||
tc = talloc_chunk_from_ptr(ptr);
|
||||
|
||||
if ((size < tc->size) && ((tc->size - size) < 1024)) {
|
||||
tc->size = size;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* don't allow realloc on referenced pointers */
|
||||
if (unlikely(tc->refs)) {
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user