In testVshTableNew() we test whether vshTableNew(NULL) allocates
a table. This is expected to fail (and return NULL), because
passing nothing but NULL to vshTableNew() is viewed as error.
Nevertheless, if vshTableNew() did not fail and returned an
allocated table it would be leaked.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
static int
testVshTableNew(const void *opaque G_GNUC_UNUSED)
{
- if (vshTableNew(NULL)) {
+ g_autoptr(vshTable) table = vshTableNew(NULL);
+
+ if (table) {
fprintf(stderr, "expected failure when passing null to vshTableNew\n");
return -1;
}