Convert code to use g_autofree and g_autoptr
g_autofree is a feature provided by GLib and the C compiler which will free a variable when it goes out of scope.
g_autoptr works similarly, but it will call a custom registered free function instead.
We are slowly converting the code to use these new patterns. Any variable that is allocated and free'd within a single function can likely be converted to use
g_autoptr. Similarly, any usage of
VIR_FREE under a
cleanup: label can likely be converted.