:
gchar *string = function2(function1("something"));
g_free (string);
function1(). . , , , :
gchar *temp, *string;
temp = function1("something");
string = function2(temp);
g_free(temp);
temp = NULL;
g_free(string);
, , , function1() , , , (- , , free() d).
- function2():
gchar *function2_wrapper(gchar *c)
{
gchar *ret = function2(c);
free(c);
return ret;
}
gchar *string = function2_wrapper(function1("something"));
, , , , , , , , , , , double- free() , ,