From nobody Mon Feb 9 03:17:01 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=1608153215; cv=none; d=zohomail.com; s=zohoarc; b=k4Mcl2IYIVbxbe33aZOEwDJN0WjTdrzk44zqGZuE8DOe8J6uMHtD+R2YDHHLeXMO85xU6K7yS7ZPiiCndQcjyvBQ/j57nv7LOgZOL55HHwRdsf8qTJCDmF3pWzMcdJS7vok+VsSglEaOrtgn9pq1ClszB4RmoW9jstMkZ1WQgQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608153215; 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=5h91A7uIO9Gb2oIpENyGbsgdSYcMtAdZyOvmkiUBcCI=; b=SassncR/tGpymJCd6PuC5e7gkTQO6+GRnfNl0BzB/jtK6BiFdsY1MS98DKZ3BVexj7s8nnhUIPzXboozUywxrKG0O9AzBac2Z7a9S2yP68WUwLQfybS2yJ5bYWe/K341zjfp/Mr8axcDrtv3KTwBZCMQTkBONO0nwwMQCd1exdM= 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 1608153214961676.8798139132609; Wed, 16 Dec 2020 13:13:34 -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-464-LWHaiKh6Pbu5VCfJxmmj6A-1; Wed, 16 Dec 2020 16:13:30 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3071800D53; Wed, 16 Dec 2020 21:13:24 +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 A010560BF3; Wed, 16 Dec 2020 21:13:24 +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 682031809CA2; Wed, 16 Dec 2020 21:13:24 +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 0BGLD8vj005924 for ; Wed, 16 Dec 2020 16:13:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 975ED1F4; Wed, 16 Dec 2020 21:13:08 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 193241971D for ; Wed, 16 Dec 2020 21:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608153212; 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=5h91A7uIO9Gb2oIpENyGbsgdSYcMtAdZyOvmkiUBcCI=; b=T70uubvWYEF6A+Aua5j9KIpQPAdm62hyVezZXp+2Z9LV02uRbDi9+V+o3rhdhLty8Amo56 GF0WbtP+7xrAcHvUM4F6yxBk5ITaiv8kAR8oydwHkAKVy2K/M8pk1Z85s5t3qnSdv+fCQZ fHwYzAXWB+m/k3Gr7OhQXGGK1EtZjDo= X-MC-Unique: LWHaiKh6Pbu5VCfJxmmj6A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] lxc: Allow NULL argument to lxcDomainDefNamespaceFree() Date: Wed, 16 Dec 2020 22:12:59 +0100 Message-Id: <495e1b75ea507f6f105def5136710875e8e6b9ac.1608153074.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 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" As all other free functions, NULL should be accepted. Even though there currently is no caller that would pass NULL, there will be in future patches. Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- src/lxc/lxc_domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index df60519fca..707262336b 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -195,6 +195,10 @@ lxcDomainDefNamespaceFree(void *nsdata) { size_t i; lxcDomainDefPtr lxcDef =3D nsdata; + + if (!lxcDef) + return; + for (i =3D 0; i < VIR_LXC_DOMAIN_NAMESPACE_LAST; i++) g_free(lxcDef->ns_val[i]); g_free(nsdata); --=20 2.26.2