mirror of https://github.com/yshui/picom.git
cache: zero initialize the key string
I thought `cvalloc` wraps `calloc`, but it's `malloc`... Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
5fa870ae66
commit
d1888b612c
|
@ -21,7 +21,7 @@ int cache_get_or_fetch(struct cache *c, const char *key, size_t keylen,
|
|||
return err;
|
||||
}
|
||||
// Add a NUL terminator to make things easier
|
||||
(*value)->key = cvalloc(keylen + 1);
|
||||
(*value)->key = ccalloc(keylen + 1, char);
|
||||
memcpy((*value)->key, key, keylen);
|
||||
|
||||
HASH_ADD_KEYPTR(hh, c->entries, (*value)->key, keylen, *value);
|
||||
|
|
Loading…
Reference in New Issue