Fixed semicolon issue, as well as a double free() call