This method will always succeed.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
int nparams = 0;
int rv = -1;
virConnectPtr conn = remoteGetHypervisorConn(client);
- g_autoptr(virIdentity) ident = NULL;
+ g_autoptr(virIdentity) ident = virIdentityNew();
if (!conn)
goto cleanup;
if (virConnectSetIdentityEnsureACL(conn) < 0)
goto cleanup;
- if (!(ident = virIdentityNew()))
- goto cleanup;
-
if (virIdentitySetParameters(ident, params, nparams) < 0)
goto cleanup;
g_autofree char *username = NULL;
g_autofree char *groupname = NULL;
g_autofree char *seccontext = NULL;
- g_autoptr(virIdentity) ret = NULL;
-
- if (!(ret = virIdentityNew()))
- return NULL;
+ g_autoptr(virIdentity) ret = virIdentityNew();
if (client->sock && virNetSocketIsLocal(client->sock)) {
gid_t gid;
g_autofree char *username = NULL;
g_autofree char *groupname = NULL;
unsigned long long startTime;
- g_autoptr(virIdentity) ret = NULL;
+ g_autoptr(virIdentity) ret = virIdentityNew();
#if WITH_SELINUX
char *con;
#endif
g_autofree char *token = NULL;
- if (!(ret = virIdentityNew()))
- return NULL;
-
if (virIdentitySetProcessID(ret, getpid()) < 0)
return NULL;