(mem_getkeys): allocate one more the we have elements so its possible

to store the NULL pointer at the end.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20396 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-04-18 13:48:28 +00:00
parent ed26f631b1
commit 5b5ea66379

View File

@@ -162,7 +162,7 @@ mem_getkeys(hx509_context context,
for (i = 0; mem->keys && mem->keys[i]; i++)
;
*keys = calloc(i, sizeof(**keys));
*keys = calloc(i + 1, sizeof(**keys));
for (i = 0; mem->keys && mem->keys[i]; i++) {
(*keys)[i] = _hx509_private_key_ref(mem->keys[i]);
if ((*keys)[i] == NULL) {