Ok, so with a statically allocated buffer the the malloc memory leak goes away right?

Something like

<code>
  static char str[80];
</code>

instead of

<code>
char *str = malloc (sizeof (char));
</code>