Rfc6810 bis

pull request for reviewing code
*result would be false if realloc returned NULL, in this case the free() operation would do nothing because *result would be NULL.
It's missing here to free() the previous allocated memory:

```
       The realloc() function returns a pointer to the newly allocated memory, which is suitably aligned for any built-in type and  may
       be  different from ptr, or NULL if the request fails.  If size was equal to 0, either NULL or a pointer suitable to be passed to
       free() is returned.  If realloc() fails, the original block is left untouched; it is not freed or moved.
```