removed strdup from g_string_append
fixed memory leaks in various files