diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-01-05 13:12:36 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-01-05 13:12:36 +0000 |
commit | 7496d32fb41629cfd0f4daddf659668fd2df56b1 (patch) | |
tree | c25376cb8a4c644886aeac0ea0f2df20e6570d13 /usr.sbin/bgpd/rde_sets.c | |
parent | bb6484cbfaeaf3cc5f9db03f5ec912cacc7a1ee2 (diff) |
Correctly account for the memory allocated when creating a set.
Should hopefully fix the error seen on systems after a few reloads where
the size became negative.
OK benno@
Diffstat (limited to 'usr.sbin/bgpd/rde_sets.c')
-rw-r--r-- | usr.sbin/bgpd/rde_sets.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde_sets.c b/usr.sbin/bgpd/rde_sets.c index 5621af1bf5f..b533773b6bd 100644 --- a/usr.sbin/bgpd/rde_sets.c +++ b/usr.sbin/bgpd/rde_sets.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_sets.c,v 1.6 2018/10/26 16:53:55 claudio Exp $ */ +/* $OpenBSD: rde_sets.c,v 1.7 2019/01/05 13:12:35 claudio Exp $ */ /* * Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org> @@ -127,6 +127,7 @@ set_new(size_t nmemb, size_t size) rdemem.aset_cnt++; rdemem.aset_size += sizeof(*set); + rdemem.aset_size += set->size * set->max; return set; } |