MINOR: lru: do not allocate useless memory in lru64_lookup

lru64_lookup function was added in a previous patch of mine. This one
just remove a useless memory allocation.
This commit is contained in:
Christopher Faulet 2015-07-28 16:01:07 +02:00 committed by Willy Tarreau
parent ffaf30b689
commit 3c3a035be0
1 changed files with 0 additions and 9 deletions

View File

@ -39,15 +39,6 @@ struct lru64 *lru64_lookup(unsigned long long key, struct lru64_head *lru,
struct eb64_node *node;
struct lru64 *elem;
if (!lru->spare) {
if (!lru->cache_size)
return NULL;
lru->spare = malloc(sizeof(*lru->spare));
if (!lru->spare)
return NULL;
lru->spare->domain = NULL;
}
node = __eb64_lookup(&lru->keys, key);
elem = container_of(node, typeof(*elem), node);
if (elem) {