summaryrefslogtreecommitdiff
path: root/lib/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hash.c')
-rw-r--r--lib/hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hash.c b/lib/hash.c
index a7714f1569..e74e4355dc 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -94,6 +94,10 @@ static void hash_expand(struct hash *hash)
struct hash_backet *hb, *hbnext, **new_index;
new_size = hash->size * 2;
+
+ if (hash->max_size && new_size > hash->max_size)
+ return;
+
new_index = XCALLOC(MTYPE_HASH_INDEX,
sizeof(struct hash_backet *) * new_size);
if (new_index == NULL)