Message ID | 20181114160221.18242-3-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBHEOWHPQKGQE7UA4U5Q@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43f; helo=mail-wr1-x43f.google.com; envelope-from=swupdate+bncbcxploxj6ikrbheowhpqkgqe7ua4u5q@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="jnvb9sU5"; dkim-atps=neutral Received: from mail-wr1-x43f.google.com (mail-wr1-x43f.google.com [IPv6:2a00:1450:4864:20::43f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42w8Ql3NZKz9sB7 for <incoming@patchwork.ozlabs.org>; Thu, 15 Nov 2018 03:02:39 +1100 (AEDT) Received: by mail-wr1-x43f.google.com with SMTP id v2-v6sf17520587wrn.0 for <incoming@patchwork.ozlabs.org>; Wed, 14 Nov 2018 08:02:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542211357; cv=pass; d=google.com; s=arc-20160816; b=oKXSG3SX1iwdJOvWeMFZowODs4aM15iacLh5eLo9XGpr7yzwIsPtQ49Qz2pn9zrwZw gHfwy4/fjKyDLbrkizERTNZU2UTNmpFkRAkXKjjZJH4ElCxmFbWHpo5x5cY5N8o73u+c JBaJIZAtzZnPTS37On2XR2Eo102TUomBTd5cHb4YmVgnrJQdkx24MuZZ0mDg1TPh7tn5 GcftxhpiAVfTbehmqbr+IcgFrz17NKsUmVkqtSQzn7DGlH/Zx+TOj8HnoXEQo+0ph0hE qXeBHRQetSCscp4DzfKhIFNP2Va1ZaG3m3mUs9hszm08gtCZxCmDYDpgxZk1yKrJ3CbG TDoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:mime-version:sender:dkim-signature; bh=E6Qy71KVzIE+sqkrWorA99t/UIr0WbjVuBtYhcmfxyU=; b=c/a3BdSwSuv4kwB0r1j9GLSKWYXsf5Mi0iaJb7vA8cgThmiHQpuFES5sHP3n/aqFCr nPYnv5MNPCC+i/j9M/byxf+4Acf9tv6inzA/UZTpXZpegZx/5qhJm6HuV9u3lwN5yMxI Dy6M3Htihtv9t8zxqgKc/xCRItWheAOHoLK+2eVxo/Z6SFsctpH+7uVmNvzOxGbS8T+v S1uRbDrsXXSC872HMj65gRsxhuyAxSwAf1ab8RijkTGVznlE46TCr/bPU8wHioOmRPuR S2g//5qE0oNsF1pUB1ka0Kq8Uxcw9GVETTsBq7j57K3vV1xQGrWnDVAYg/BGHlCKch+e xrWw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=E6Qy71KVzIE+sqkrWorA99t/UIr0WbjVuBtYhcmfxyU=; b=jnvb9sU5mZR4Dyc6QIW4RpIxq+eVk7nt7NHyWh8yOH9JAESnFizuCWJLngMF0q6bw0 z9O/RTj9cTbRiuVqE40vkkd8Dj4M2nnbQpvIhKEm5V7Ty2Y4DBpUsoLW1gXSa2MuUK26 AtDDpbOiXoojkqao/L4RvP8FxHBBU3N5m808g7MFwdI9mQAp+rUAapW66U4yIR1dnrZ3 9OBYd+6T8X9yXMBT2IcBvEIcUZBrxda0di3os2v0NmHTtEucM0SumNxfr3s2ciTXcJCE K8CTBbapvtVP1/PSWktXjhxMQPzScF7OUOmE7xmQdFTFYbYxbDDPAeVH3PJlxgCbPTZo m6gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=E6Qy71KVzIE+sqkrWorA99t/UIr0WbjVuBtYhcmfxyU=; b=trlMaiM4T/88Vvkq1uiXdRWVwkmYTo0ixGK9XpT3aSpgKXsO1pn+vp7YOFhWhr0osE jAgUmeb+JoqDQCHXkg3mL4YgZg7HPFQiPAbEr+NgoMNWRqrBnCcyJ710rSpdsm0Cn+f+ j/2nLknwOKJvbwu9Hj9h1pRGKWqYeHFb8TKln3gs23vzv0338f3t5iV4SzGgJygwCvV3 faKrOF5PCdwiVoLIleYusQKuQjft5VYT+/QEJJUdu77/7trZCkIqwQsbnhkTBxB9YFui LLRxbGE6ts4BiMisxgBT+zejLQnLkJxF3rzxURMDz8C+FvvL8sH9QsS0w5b+Ew29DLB3 qL6Q== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGRZ1gIJbXDng+u9j0VRWcdLL8Uew3kUMPPGJenMtVbtvfM5urpTBzkl PVFm8V84Egxv9r7j7vTpgZs= X-Google-Smtp-Source: AJdET5cUf1x3sA2d9yngyZTggkgwJHKiFCG6NCK/3K8xo7WHlXHBmnbq+pDkc2u94dU3rPC66+oFpw== X-Received: by 2002:adf:e60d:: with SMTP id p13mr34967wrm.6.1542211357005; Wed, 14 Nov 2018 08:02:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:44d6:: with SMTP id r205ls252340wma.24.canary-gmail; Wed, 14 Nov 2018 08:02:36 -0800 (PST) X-Received: by 2002:a1c:b482:: with SMTP id d124-v6mr479640wmf.16.1542211356463; Wed, 14 Nov 2018 08:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542211356; cv=none; d=google.com; s=arc-20160816; b=K0OfrEI0fmSq4C7XGQD/XxzZ+zX/if7121SUidLGloYa/OjLBR2V+vHVkTG//1WKj1 CQPWymQi4LqbtBEn2OUy1KrL2WU18AgVOcIQA3f1k4WrW28/7l55iI1Q/f5v3rKmxged ywhudmbdDArUWJwMcEtqO/XFDETsRH2iuEtN4LLiOyVzTG2/oLkQJHt/5+2zZrrYZ+c7 JQsNyCbZXkxLBVnkoi4ndkWauOjBQhi+YuGa7b1B7UaE1+AWHvNXLNl9BLUwUUv5QacE 0gcUpZtbheNP3oo8Eb1YUAKSoeLn+C4HsxyH6qIJHoK6/F1GcYx4fXKXIFJXA30PpvDu 7zaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=NKOq6u6JqqIcxwsVBR4uufPHHIv/xsOxrdAT6AdPomI=; b=ryE2b1bp6/Ce2uWPOTuMizA1Q57FL68UxVI4wi6syLfAIw+oQSoOEj7FiFQOFGfyiP ixMnCRTEZth7OL+Ma1GiIfA/E7xnSJGFVE1ORkc1EWXCbiaZHyrhCh/nMTizEjczK1mO 7aSNWmVhMKvPS5O1DP6SVPCTbfpUEk7M2GNlnA0V4L4V+6uJ8997uZ2brRLWKF+xcoED +5F+mer+WMFw4OKHqjsJFLe3xog9oiEqwubD2K4h4BJ3iqrUpEjGYf2ZLz9SRdprGcMe e88rcitNSbIthBbcONEC8BprMBqlKyMw+3j2JNK3li1Kdm+tFxy5ZVXLulkMT7+mVTDA i7zA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id l4-v6si676230wrb.4.2018.11.14.08.02.36 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 08:02:36 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 42w8Qh1y3Jz1r2tM; Wed, 14 Nov 2018 17:02:36 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 42w8Qh1hB5z1qqkW; Wed, 14 Nov 2018 17:02:36 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id HMxzYT8NNIbA; Wed, 14 Nov 2018 17:02:32 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 14 Nov 2018 17:02:32 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 3BCDB4540038; Wed, 14 Nov 2018 17:02:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nGaNZ0mYbCSX; Wed, 14 Nov 2018 17:02:26 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id BBA654540474; Wed, 14 Nov 2018 17:02:23 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH v2 2/5] util: function to free an array of strings Date: Wed, 14 Nov 2018 17:02:18 +0100 Message-Id: <20181114160221.18242-3-sbabic@denx.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114160221.18242-1-sbabic@denx.de> References: <20181114160221.18242-1-sbabic@denx.de> X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Support for links into sw-description.
|
expand
|
diff --git a/core/util.c b/core/util.c index a357ea3..3ad0fd0 100644 --- a/core/util.c +++ b/core/util.c @@ -497,6 +497,16 @@ unsigned int count_string_array(const char **nodes) return count; } +void free_string_array(char **nodes) +{ + char **iter; + if (!nodes) + return; + for (iter = nodes; *iter != NULL; iter++) + free(*iter); + free(nodes); +} + unsigned long long ustrtoull(const char *cp, unsigned int base) { errno = 0; diff --git a/include/util.h b/include/util.h index 0a95967..faf8aec 100644 --- a/include/util.h +++ b/include/util.h @@ -180,6 +180,7 @@ __u64 version_to_number(const char *version_string); int check_hw_compatibility(struct swupdate_cfg *cfg); int count_elem_list(struct imglist *list); unsigned int count_string_array(const char **nodes); +void free_string_array(char **nodes); /* Decryption key functions */ int load_decryption_key(char *fname);
Signed-off-by: Stefano Babic <sbabic@denx.de> --- Changes in v2: None core/util.c | 10 ++++++++++ include/util.h | 1 + 2 files changed, 11 insertions(+)