From nobody Wed Dec 17 00:12:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528124716508186.80296440401207; Mon, 4 Jun 2018 08:05:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA8B730C4ACF; Mon, 4 Jun 2018 15:05:14 +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 693B52010CD1; Mon, 4 Jun 2018 15:05:14 +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 EBE051800FD9; Mon, 4 Jun 2018 15:05:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w54Eaw7D008164 for ; Mon, 4 Jun 2018 10:36:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id D36D45C8AB; Mon, 4 Jun 2018 14:36:58 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB74B17AF9 for ; Mon, 4 Jun 2018 14:36:58 +0000 (UTC) Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F007B3002A0F for ; Mon, 4 Jun 2018 14:36:46 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id w12-v6so13320545pgc.6 for ; Mon, 04 Jun 2018 07:36:46 -0700 (PDT) Received: from centos.localdomain ([42.106.2.208]) by smtp.gmail.com with ESMTPSA id f63-v6sm23448806pfe.143.2018.06.04.07.36.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 07:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=CJ9o3iG/haNkIK5yXOOoeWmmSWDAUM2CqN+Xoe33P7k=; b=DWZE3VkeqOigsIovgV0ERdd8G3Wh9TZO2xWXnfqAy/4ZBByySkdqgh0x3HprRpnlCj qT0Ior00ruWGoMx/uAKsb32xMTR5vEpgNvvGPtp5kTMZuTp4KGSn4BxL1rVcghgyrZXW a4JoBZlRH+ouFJWMgJmPLhPqnFbTf1jD62CBCVfS6u7vXf5ERuyICmTGW3HrZS4UdeT/ Yy0C6BZSWYZsVOmV+5g1jaKZgT7A4EaMjZS6OE95oCGbbU65hR+5ap6S0i5qBojUyhhN LfyBbJmVzSPprhENF3MNWqT5JhActVk1HLATCnMYHa/HP8PlxvD5AhI/70VmMW/E0qMg twTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=CJ9o3iG/haNkIK5yXOOoeWmmSWDAUM2CqN+Xoe33P7k=; b=q8Z/B3G1Yx4O5M83fbvcEWXnhiPuD0BWaSQa+aBV9xTts5p0x0ArtWoFZMoxAgwARu NHFkdNO5bIqWzfE7Hw5xL9TpKBwaUDbqEag51///VI6UDdglfCjugcoMDolarbl9qyAA qlNR148h8J8ynwQm4RutjpNVVGwBH4UKk7jbsJTXGPdyG0P0APeFqgYq8Gwpdm/46j/n UKiL89gLT5SooC2mDeyFQFjNtG1T+vCOjbAEd7KKnqN1N4p1zHJawd7IvPpVgIJ4igqI iuKLO89RNL6o2UZOq36WQYFPxyjFEvjFMj/WJe6Q9B6Ow2W+esLViB4akzBZdO0Pad5k +dMQ== X-Gm-Message-State: APt69E0KSbfDhFWHtHgs/MjnaJMqzVAEX8gZtWKoTszHCrzHQ44MRg67 +YOvztlxpsulIVfEMsFNKE32OiYh X-Google-Smtp-Source: ADUXVKJnr0q4AE7qe88+zHl2T6eSV+qvutEy0gqYJLqGURA3NDOOK2wrisNTasmtOv4HScoIkjZLRQ== X-Received: by 2002:a62:484d:: with SMTP id v74-v6mr7469013pfa.256.1528123006169; Mon, 04 Jun 2018 07:36:46 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sun, 3 Jun 2018 13:42:09 +0530 Message-Id: <1528013536-22196-12-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1528013536-22196-1-git-send-email-skrtbhtngr@gmail.com> References: <1528013536-22196-1-git-send-email-skrtbhtngr@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 04 Jun 2018 14:36:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 04 Jun 2018 14:36:47 +0000 (UTC) for IP:'74.125.83.67' DOMAIN:'mail-pg0-f67.google.com' HELO:'mail-pg0-f67.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.766 * (DATE_IN_PAST_24_48, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 74.125.83.67 mail-pg0-f67.google.com 74.125.83.67 mail-pg0-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 11/18] use VIR_AUTOFREE in src/util/vireventpoll.c 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 04 Jun 2018 15:05:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/vireventpoll.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c index 81ecab4..13d278d 100644 --- a/src/util/vireventpoll.c +++ b/src/util/vireventpoll.c @@ -618,7 +618,7 @@ static void virEventPollCleanupHandles(void) */ int virEventPollRunOnce(void) { - struct pollfd *fds =3D NULL; + VIR_AUTOFREE(struct pollfd *) fds =3D NULL; int ret, timeout, nfds; =20 virMutexLock(&eventLoop.lock); @@ -645,7 +645,7 @@ int virEventPollRunOnce(void) goto retry; virReportSystemError(errno, "%s", _("Unable to poll on file handles")); - goto error_unlocked; + return -1; } EVENT_DEBUG("Poll got %d event(s)", ret); =20 @@ -662,13 +662,10 @@ int virEventPollRunOnce(void) =20 eventLoop.running =3D 0; virMutexUnlock(&eventLoop.lock); - VIR_FREE(fds); return 0; =20 error: virMutexUnlock(&eventLoop.lock); - error_unlocked: - VIR_FREE(fds); return -1; } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list