From patchwork Thu Jun 18 15:50:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 486362 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 9D5E61401F0 for ; Fri, 19 Jun 2015 01:52:04 +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=bHxDjYpP; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 53BC528C109; Thu, 18 Jun 2015 17:51:28 +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 15E5228C0E9 for ; Thu, 18 Jun 2015 17:51:01 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-wg0-f49.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 18 Jun 2015 17:50:56 +0200 (CEST) Received: by wgbhy7 with SMTP id hy7so67512399wgb.2 for ; Thu, 18 Jun 2015 08:51:00 -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=ZeKcj3ZJq0U8Tx7P2g2quE/95W4/jTUJPMCMUM345gk=; b=bHxDjYpPEJ7miIOUgs88nDKhX8PGWWYTTKnVpxW/u/NPa7Ir/2UxZcL3T5iIfEkMZ2 C7653tOs6ZEJBCyj58p06odViTJK93gpc7F2eaUhH07bi48C3A19WD4ax6OHNdG94Rvz WGJiaGn1S1HgKKxzaVoUVfymaSXwD4UoR4rV92nC5/KZSPl2S7SA3AFMKky/iF3T94+m BUJCTALOa1ZclllecBx3/ql8K8mqkQglJm3CJ0c/jABMl6mCM3YpcAKYfWLe64Lk53FO tdWB4G29gr2xuKCai3SACihqC9n2dQNDEkyNEUQD/zUAjSHr0ijibxcPI2YSgTeJyPpj Mljg== X-Received: by 10.194.175.65 with SMTP id by1mr4953760wjc.152.1434642660453; Thu, 18 Jun 2015 08:51:00 -0700 (PDT) Received: from orion.local ([5.2.198.78]) by mx.google.com with ESMTPSA id s8sm8625028wik.5.2015.06.18.08.50.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Jun 2015 08:51:00 -0700 (PDT) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Thu, 18 Jun 2015 18:50:47 +0300 Message-Id: <1434642649-20330-2-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 2/4] swconfig: swlib.c: remove const qualifier for val.s since this is supposed to be free'd 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 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 334d148..f74c093 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -363,7 +363,7 @@ int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *a, int por val.value.i = atoi(str); break; case SWITCH_TYPE_STRING: - val.value.s = str; + val.value.s = (char *)str; break; case SWITCH_TYPE_PORTS: ports = alloca(sizeof(struct switch_port) * dev->ports); diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index bb2ebd8..28bdd7f 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -135,7 +135,7 @@ struct switch_val { int err; int port_vlan; union { - const char *s; + char *s; int i; struct switch_port *ports; } value;