" 1 fedora28 running\n"
" 2 rhel7.5 running\n";
- vshTable *table = vshTableNew("Id", "Name", "State",
+ g_autoptr(vshTable) table = vshTableNew("Id", "Name", "State",
NULL); //to ask about return
if (!table)
goto cleanup;
cleanup:
VIR_FREE(act);
- vshTableFree(table);
return ret;
}
{
int ret = 0;
- vshTable *table = vshTableNew("Id", "Name", NULL);
+ g_autoptr(vshTable) table = vshTableNew("Id", "Name", NULL);
if (!table)
goto cleanup;
}
cleanup:
- vshTableFree(table);
return ret;
}
"-----------------------------------------\n"
" 1 fedora28 running\n"
" 2 つへソrhel7.5つへソ running\n";
- vshTable *table;
+ g_autoptr(vshTable) table = NULL;
table = vshTableNew("Id", "名稱", "государство", NULL);
if (!table)
ret = -1;
cleanup:
- vshTableFree(table);
return ret;
}
"-------------------------------------------------------------------------------------------\n"
" 1 ﻉﺪﻴﻟ ﺎﻠﺜﻘﻴﻟ ﻕﺎﻣ ﻊﻧ, ٣٠ ﻎﻴﻨﻳﺍ ﻮﺘﻧﺎﻤﺗ ﺎﻠﺛﺎﻠﺛ، ﺄﺳﺭ, ﺩﻮﻟ ﺩﻮﻟ. ﺄﻣﺎﻣ ﺍ ﺎﻧ ﻲﻜﻧ\n"
" ﺺﻔﺣﺓ ﺖﻜﺘﻴﻛﺍً ﻊﻟ, ﺎﻠﺠﻧﻭﺩ ﻭﺎﻠﻌﺗﺍﺩ ﺵﺭ\n";
- vshTable *table;
+ g_autoptr(vshTable) table = NULL;
wchar_t wc;
/* If this char is not classed as printable, the actual
ret = -1;
cleanup:
- vshTableFree(table);
return ret;
}
testUnicodeZeroWidthChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
const char *exp =
" I\u200Bd Name \u200BStatus\n"
"--------------------------\n"
ret = -1;
cleanup:
- vshTableFree(table);
return ret;
}
testUnicodeCombiningChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
const char *exp =
" Id Náme Ⓢtatus\n"
"--------------------------\n"
ret = -1;
cleanup:
- vshTableFree(table);
return ret;
}
testUnicodeNonPrintableChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
const char *exp =
" I\\x09d Name Status\n"
"----------------------------------\n"
ret = -1;
cleanup:
- vshTableFree(table);
return ret;
}
testNTables(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
- vshTable *table1 = NULL;
- vshTable *table2 = NULL;
- vshTable *table3 = NULL;
+ g_autoptr(vshTable) table1 = NULL;
+ g_autoptr(vshTable) table2 = NULL;
+ g_autoptr(vshTable) table3 = NULL;
const char *exp1 =
" Id Name Status\n"
"--------------------------\n"
ret = -1;
cleanup:
- vshTableFree(table1);
- vshTableFree(table2);
- vshTableFree(table3);
return ret;
}