From nobody Tue Apr 30 02:19:21 2024 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 1542217702469546.1999400688377; Wed, 14 Nov 2018 09:48:22 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 954B9315487A; Wed, 14 Nov 2018 17:48:20 +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 57E1460BF6; Wed, 14 Nov 2018 17:48:20 +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 0FC10181A134; Wed, 14 Nov 2018 17:48:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAEHWtSH014505 for ; Wed, 14 Nov 2018 12:32:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id DEAB46019F; Wed, 14 Nov 2018 17:32:55 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D45EC601AD for ; Wed, 14 Nov 2018 17:32:50 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (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 B19153086254 for ; Wed, 14 Nov 2018 17:32:49 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id m5so27220064qka.9 for ; Wed, 14 Nov 2018 09:32:49 -0800 (PST) Received: from localhost.localdomain ([2804:431:b704:5cdb:adf7:2bc7:ec25:714]) by smtp.gmail.com with ESMTPSA id x57sm17320183qtx.96.2018.11.14.09.32.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 09:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ntP/sz0/3PTUTzPSbR7lfZLLIZmrbsn8GOqmArvBRR0=; b=XQpYqYbNTABQC2x3juwVfWgDbRKz2zF+8Fv2s7yipcvIY7ne8A5jGkdQz2Mp3PFgXT 55q2MEeTrNtPYg4PlS6+m+2SE4I3BNQDi6jy8YMuf+I2O9Rzs2QgadxsekdZiSAQWc/M 2VnJRimNr773F8muc98ghk3prUDOmsBK7fERz2b7yZ1v5Dl3taYQmIiy9tkG2NplD8BE 800bp7Z91DtQ9kw9eE5tVgV41Rd0m0a+7uRJQrJ8vwQo6NeKZyyzwuKJLFIninxzVe0+ dWrabkI7aQ7Omkhswun0kIOiWFDRspaHyccA50tf6Qv5pLX0pJzJlVDMykXvHtnsZ0jI USxw== 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:mime-version :content-transfer-encoding; bh=ntP/sz0/3PTUTzPSbR7lfZLLIZmrbsn8GOqmArvBRR0=; b=f2NQ6i3VkFJ8dR7vSuFArfSRfhF87qql6VQv4U0FWLNQfaXq3/B9ujzBAmol+t6Aq0 P2VL9WZDut66y9SOGVw0ECGAi1sRSWJ5QIIAMgwUcdV9RInAMBeT02cua0prgqU3Y8b4 CTCrtJckPFumPB+ZP7rnkZp6Yx8NhSgY20BXolk7rWd/+ee/ZZc8c86O+JOhZ3ua1dVj Kgla1bnU0K5aiFhjd4dpE8ZHjHj5cu4dQBfnikJstbfxAXk0zMXDIJ+yqAI7vAEC70MW yUCtDja13USaA4sLRQtuHGaoJFb6vcv63T8uOSYsBccEwfUpctU9VmJKeQyKrZ4ycSfO hXIw== X-Gm-Message-State: AGRZ1gI15CK9jswbRNpJ6+9u+aGuoFbWjtOl7KfCZWyQKng6kKKdJ5ED feAfqhQBfVYk+YZ7hCYzDzWwWsdXBOk= X-Google-Smtp-Source: AJdET5dG31O3dpTcQlgNw2xnsad0gICu78E6FgZ2AmRCwpQCBXa48SvJC7+zwKWrEoM4nMx7v5Gb9g== X-Received: by 2002:a0c:e5c1:: with SMTP id u1mr2797097qvm.113.1542216768419; Wed, 14 Nov 2018 09:32:48 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 15:32:31 -0200 Message-Id: <20181114173231.19181-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 14 Nov 2018 17:32:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 14 Nov 2018 17:32:49 +0000 (UTC) for IP:'209.85.222.193' DOMAIN:'mail-qk1-f193.google.com' HELO:'mail-qk1-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.193 mail-qk1-f193.google.com 209.85.222.193 mail-qk1-f193.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Using virStringListFreeCount instead VIR_FREE to free tmpPaths. 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 14 Nov 2018 17:48:21 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The function qemuDomainGetHostdevPath() is using VIR_FREE to free the paths stored in tmpPaths. Both syntax analyzer are reporting a warning about this. Replacing the old method to function virStringListFreeCount() fixes the warnings/errors. Signed-off-by: Julio Faracco Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 37926850b2..c374219aab 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11132,9 +11132,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def, } ret =3D 0; cleanup: - for (i =3D 0; i < tmpNpaths; i++) - VIR_FREE(tmpPaths[i]); - VIR_FREE(tmpPaths); + virStringListFreeCount(tmpPaths, tmpNpaths); VIR_FREE(tmpPerms); virPCIDeviceFree(pci); virUSBDeviceFree(usb); --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list