From nobody Tue Feb 10 04:03:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576749929; cv=none; d=zohomail.com; s=zohoarc; b=iv5s7PSxfmo3cFj7JHrE6PNVZMh+Ce7Yz6KpYbDZulWVgslf4mf/vEfmTUmjf2FfbEqZQUnTaijhm3DpzIxcplT5ETQTVFysRWsO/HYs6Q4fhEEzPp1q3YIrKoFijdaJoOeYpww6jHlsoMYCvjWd7mWoKUZu9G4IowDUZyi9Yv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749929; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TaEDuwLoxmvuqdn9Wiij7ssOGZJc18Uc8PRzf79QLLQ=; b=FgUwHeRlUt7+7t2dD2hFvkqOMlFesFrswqi4iXWy7fMxwDthxP+/G+vBTpeYgijDE2FhyetbZAExHhgDeqP3F4d0f3t1EJgIwB81tglofZPh+iG3mw+h80Xfl0pvGzMvWDMdf5m0Uou9VDddwZhWJ4F+8xpuRHO9JDwXPqZUsjY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576749929727994.9651551724975; Thu, 19 Dec 2019 02:05:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-rj1NEQCvNbO2qVmgTPeGtg-1; Thu, 19 Dec 2019 05:05:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BFC3DB60; Thu, 19 Dec 2019 10:05:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 38B6826E48; Thu, 19 Dec 2019 10:05:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D7F8818089C8; Thu, 19 Dec 2019 10:05:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBJA4vZI010792 for ; Thu, 19 Dec 2019 05:04:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0396926E48; Thu, 19 Dec 2019 10:04:57 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 577FC26DF9; Thu, 19 Dec 2019 10:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749928; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TaEDuwLoxmvuqdn9Wiij7ssOGZJc18Uc8PRzf79QLLQ=; b=Mpb06E8ANXJRsAMR+3GSgckT+Zi28vaP7xiRhlQ/0nkunni+xxNCnxWwr1Ibjb1pUwfmUC pAdz6udLxxR/BRfTbEE8xDQ4VBsuun6VWKYgz+ERr/gE6zyepjcpLx7CJXJvMZmYp0wcHj zCIvlDu+CPX64/xUv9mV3qa0+biDP3M= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:08 +0100 Message-Id: <20191219100447.210836-4-fidencio@redhat.com> In-Reply-To: <20191219100447.210836-1-fidencio@redhat.com> References: <20191219100447.210836-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH 03/42] rpc: Use g_autofree on virNetClientNewLibSSH2() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: rj1NEQCvNbO2qVmgTPeGtg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetclient.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 47a17d30f7..75e653fec8 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -442,13 +442,13 @@ virNetClientPtr virNetClientNewLibSSH2(const char *ho= st, virNetClientPtr ret =3D NULL; =20 virBuffer buf =3D VIR_BUFFER_INITIALIZER; - char *nc =3D NULL; - char *command =3D NULL; + g_autofree char *nc =3D NULL; + g_autofree char *command =3D NULL; =20 - char *homedir =3D NULL; - char *confdir =3D NULL; - char *knownhosts =3D NULL; - char *privkey =3D NULL; + g_autofree char *homedir =3D NULL; + g_autofree char *confdir =3D NULL; + g_autofree char *knownhosts =3D NULL; + g_autofree char *privkey =3D NULL; =20 /* Use default paths for known hosts an public keys if not provided */ if (knownHostsPath) { @@ -517,12 +517,6 @@ virNetClientPtr virNetClientNewLibSSH2(const char *hos= t, goto cleanup; =20 cleanup: - VIR_FREE(command); - VIR_FREE(privkey); - VIR_FREE(knownhosts); - VIR_FREE(homedir); - VIR_FREE(confdir); - VIR_FREE(nc); return ret; =20 no_memory: --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list