Rfc6810 bis

pull request for reviewing code
same problem than in spki_table_get_all(),
the previously allocated memory will be leaked if realloc returns NULL here