diff options
author | 2016-10-12 15:51:44 +0000 | |
---|---|---|
committer | 2016-10-12 15:51:44 +0000 | |
commit | 8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9 (patch) | |
tree | 28f49e657a1c921db255916c54ce067b0ee1fb27 | |
parent | Fix a couple of problems with insert mode: flush dirty cells before we (diff) | |
download | wireguard-openbsd-8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9.tar.xz wireguard-openbsd-8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9.zip |
When allocating the h_table array use the size of struct hash_head,
not the size of a pointer. From Joris Vink. OK fcambus@
-rw-r--r-- | usr.bin/cvs/hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/hash.c b/usr.bin/cvs/hash.c index 6abad73c438..0fe624be65b 100644 --- a/usr.bin/cvs/hash.c +++ b/usr.bin/cvs/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.2 2015/01/16 06:40:07 deraadt Exp $ */ +/* $OpenBSD: hash.c,v 1.3 2016/10/12 15:51:44 millert Exp $ */ /* * Copyright (c) 2008 Joris Vink <joris@openbsd.org> * @@ -44,7 +44,7 @@ hash_table_init(struct hash_table *htable, size_t hsize) hsize = 1 << power; } - htable->h_table = xcalloc(hsize, sizeof(struct hash_head *)); + htable->h_table = xcalloc(hsize, sizeof(struct hash_head)); htable->h_size = hsize; for (i = 0; i < htable->h_size; i++) |