Potential memory leak
In Glib's g_array_free document, it said" The element data if free_segment is FALSE, otherwise NULL. The element data should be freed using g_free(). " So if the second parameter of g_array_free is FALSE, the array's element, i.e., array->data should be freed by g_free. Or it could cause potential memory leak.
Therefore, gi/pygi-value.c line 276, line 287 and line 299 could cause potential memory leak, I suggest to add g_free(array->data)