Fixed malloc issue.

   The code was previously not accounting for the NULL terminator in length.