Fixed memory leak due to g_error_free() when parsing bad JSON documents. General g_error_free() revise.