From nobody Mon Feb 9 10:32:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1638543678; cv=none; d=zohomail.com; s=zohoarc; b=DaSOMGKS/HCMmTFqBrR/kC9QdUV0N7ZAMAsIiiX6M0CHFlqIY8PLp4Alq+5ybolyNVTph5wI/tzhM2S94/xpbYG26CDr4aCOlA+kDStLdE15AL46r0Fp2EXNRYJ6ZI9umFlWJh9o8sjcFrjVR4akZ+r4ZcLo3CNW4QVqDCq+Vsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638543678; h=Content-Type:Content-Transfer-Encoding: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=jAduDWKeNmME3R8xuS+q72EnaSjoD87F4XTa0/ctsxQ=; b=ZQ6d8rSnMkY2RI5P7co1FgbP6mRq0+26yJJjQsMEvWLHgkrnCC++n5V54WNGVLrN1APj1Qt+U7SkG4lmQSP0ttVHFvovJ81WhTjNLUqGkO5VX87V3huuvw1ti0B53UUJ8/Pm3tMfk4SYbBENWLa9VFnX9PVzONl0Sl8gXvxnGcQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638543678056545.2600078111338; Fri, 3 Dec 2021 07:01:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-426-3bFLYIk7Oq6Q38lb1TQ-gA-1; Fri, 03 Dec 2021 10:01:15 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A33DD874983; Fri, 3 Dec 2021 15:00:56 +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 54242197FC; Fri, 3 Dec 2021 15:00:56 +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 D25A91802E23; Fri, 3 Dec 2021 15:00:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3EvoUG029590 for ; Fri, 3 Dec 2021 09:57:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id B13DA10023AE; Fri, 3 Dec 2021 14:57:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1338E10016F4 for ; Fri, 3 Dec 2021 14:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638543677; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=jAduDWKeNmME3R8xuS+q72EnaSjoD87F4XTa0/ctsxQ=; b=ii+tiTtAEYrxvK5z+CPwqpecS/IEXT+k2pxLl7J+yZ5WeA0ToCdA7GRc/Z4a1B+OIbqmix z4xk3sEFP6eiCnbRiq+66w/fI5Lg7kUZ1WAtU/BX+1d+I22e1yVvLECQRseSGin1y1+eAs fStrufCVqOQVj4UME3UrIRchmDRUB9s= X-MC-Unique: 3bFLYIk7Oq6Q38lb1TQ-gA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/16] virLockDaemonPostExecRestart: Automatically free temporary variables Date: Fri, 3 Dec 2021 15:57:32 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.11 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) X-ZM-MESSAGEID: 1638543680459100003 Content-Type: text/plain; charset="utf-8" Convert two temp strings and one virJSONValue to g_auto(free|ptr). Signed-off-by: Peter Krempa --- src/locking/lock_daemon.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index fc714052be..1edd912c3e 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -607,10 +607,10 @@ virLockDaemonPostExecRestart(const char *state_file, bool privileged) { const char *gotmagic; - char *wantmagic =3D NULL; + g_autofree char *wantmagic =3D NULL; int ret =3D -1; - char *state =3D NULL; - virJSONValue *object =3D NULL; + g_autofree char *state =3D NULL; + g_autoptr(virJSONValue) object =3D NULL; VIR_DEBUG("Running post-restart exec"); @@ -660,9 +660,6 @@ virLockDaemonPostExecRestart(const char *state_file, cleanup: unlink(state_file); - VIR_FREE(wantmagic); - VIR_FREE(state); - virJSONValueFree(object); return ret; } --=20 2.31.1