Rearrange free() statements, add a TODO comment.
Fix snprintf conversion specifier in GenerateClipboardHtml() to unsigned.