From patchwork Thu Jun 18 15:50:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 486364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6375F1401F0 for ; Fri, 19 Jun 2015 01:53:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Dxor/vQN; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1643228C118; Thu, 18 Jun 2015 17:51:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4228D28C0E9 for ; Thu, 18 Jun 2015 17:51:04 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 18 Jun 2015 17:51:00 +0200 (CEST) Received: by wiga1 with SMTP id a1so175623757wig.0 for ; Thu, 18 Jun 2015 08:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/BDRxYkjrzXtz6HRQoa6biIKWRSVZoNeTkNrVnfS0Ao=; b=Dxor/vQNR6Zm386d9O/G9Huifyxg9sUcOSgVDRZj+XSVEYTUzO+nqkURMPZvRclQLu qdNjj8TaBhrEbg9DtrN1OmHuR99KgBqoL9LL88FlaWRWWgtU193guDK0evevzXe4qKv2 qoI2Qba86zlW7niYseKgNMR1jwcP8QJ+qeInjLMhDKNJrOuCI9rTEcsTUkRAJy0fI5dM hnLEYHNhvrF/WmsidUZ1x8qkwUka/W+qiD7pZL5qsnG4PXoUA88vMgerenN4oWkFnQJW wu5iVLqbmqW1jLLx+/6ILzVOEta5C0vZq9pN/mochGRRheW047ThH4P+gTW6WGG5XmGa G9QA== X-Received: by 10.180.198.10 with SMTP id iy10mr38386146wic.46.1434642663456; Thu, 18 Jun 2015 08:51:03 -0700 (PDT) Received: from orion.local ([5.2.198.78]) by mx.google.com with ESMTPSA id s8sm8625028wik.5.2015.06.18.08.51.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Jun 2015 08:51:02 -0700 (PDT) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Thu, 18 Jun 2015 18:50:49 +0300 Message-Id: <1434642649-20330-4-git-send-email-ardeleanalex@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434642649-20330-1-git-send-email-ardeleanalex@gmail.com> References: <1434642649-20330-1-git-send-email-ardeleanalex@gmail.com> Cc: Alexandru Ardelean Subject: [OpenWrt-Devel] [PATCH 4/4] swconfig: swlib.c: free name and description of attributes X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Alexandru Ardelean Signed-off-by: Alexandru Ardelean --- package/network/config/swconfig/src/swlib.c | 2 ++ package/network/config/swconfig/src/swlib.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 1e0a7db..dae603c 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -749,6 +749,8 @@ swlib_free_attributes(struct switch_attr **head) while (a) { next = a->next; + free(a->name); + free(a->description); free(a); a = next; } diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index 2b42c14..7edece3 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -146,8 +146,8 @@ struct switch_attr { int atype; int id; int type; - const char *name; - const char *description; + char *name; + char *description; struct switch_attr *next; };