From nobody Mon Feb 9 08:29:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1612178948; cv=none; d=zohomail.com; s=zohoarc; b=EvtUXGB9UsNjwUZUXP9zT4HU0u846o02N0U1swzVce4MWIGaI7mWlSme/hHQ33/FaOB6jpCTWgTfnssEIGDn2TiFHfSc/iAIrw+HVowk/XW7Cf8p2YtUiFKUK1POg29y1+kxl1QluhgQiPEp9zpBQ2GBRfkC0/VjY9tQajrATPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612178948; 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=8v8Vp+bAWHl1PwnzO7075WfU9+0D8+ANTJ430fZIv0I=; b=JUDQecPU2SY7PpHhAHk65KDy9HqdHvxnv9KUUUyKVV46MjNpJsiodfVtOn6MjVb+NyTFyojVtCKfO4vp5YLOdBUIbi2N/rwGz21FNhykAiT92FKNCMNXAWQSOCAtvgEuV3wT7CYDRkV/bKONexJrCmOhCDjHjXQ5y1stkhsWw2E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1612178948472163.5889329286931; Mon, 1 Feb 2021 03:29:08 -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-260-QZceTZFjOBqjIf53LRmKww-1; Mon, 01 Feb 2021 06:29:02 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65822AFA8D; Mon, 1 Feb 2021 11:28:57 +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 445CC71C8E; Mon, 1 Feb 2021 11:28:57 +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 0D9601809CA3; Mon, 1 Feb 2021 11:28:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111BSlAa003465 for ; Mon, 1 Feb 2021 06:28:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id EF5656A90A; Mon, 1 Feb 2021 11:28:47 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 419C11840B; Mon, 1 Feb 2021 11:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612178947; 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=8v8Vp+bAWHl1PwnzO7075WfU9+0D8+ANTJ430fZIv0I=; b=GYKbJ3ikiGYMNr3U8V8c8ZeLrqnG1YbLIUoGajkGIY5ii3QDTBUY7SgNm6nJ09vRQTRxAy mpDwwlKzD08dThcbKGL3lphH+E1F8kD0PId5g+KcwJYuwOcyqxWLMNUqiDQYNUfqFPXDVX XaFKMaE70TByE2WP4iRXWzJ1h9zsFE4= X-MC-Unique: QZceTZFjOBqjIf53LRmKww-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 18/20] commandhelper: Use automatic memory management in printCwd Date: Mon, 1 Feb 2021 12:28:02 +0100 Message-Id: <20210201112804.144366-19-twiederh@redhat.com> In-Reply-To: <20210201112804.144366-1-twiederh@redhat.com> References: <20210201112804.144366-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- tests/commandhelper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 854f3c09bf..5f0c1f5a51 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -194,7 +194,7 @@ static void printDaemonization(FILE *log, struct Argume= nts *args) =20 static int printCwd(FILE *log) { - char *cwd =3D NULL; + cleanup(char *, cleanupGeneric) cwd =3D NULL; char *display; =20 if (!(cwd =3D getcwd(NULL, 0))) @@ -213,7 +213,6 @@ static int printCwd(FILE *log) # endif =20 fprintf(log, "CWD:%s\n", display); - free(cwd); return 0; } =20 --=20 2.26.2