From patchwork Mon Apr 13 15:43:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1269863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jvf1z5iQ; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 491CZy28NVz9sSY for ; Tue, 14 Apr 2020 01:43:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6008C86FAD; Mon, 13 Apr 2020 15:43:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ITgpVNO0WHZ2; Mon, 13 Apr 2020 15:43:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 8291585F8E; Mon, 13 Apr 2020 15:43:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 73F2BC1797; Mon, 13 Apr 2020 15:43:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1F1DEC0172 for ; Mon, 13 Apr 2020 15:43:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0839F85F8E for ; Mon, 13 Apr 2020 15:43:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9oM7gYIHbUDG for ; Mon, 13 Apr 2020 15:43:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 8372585958 for ; Mon, 13 Apr 2020 15:43:48 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id o1so3097569pjs.4 for ; Mon, 13 Apr 2020 08:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=x9HNaFvYROWR/q0WigaQ04GwrP/LdXxab9x3kGA1upY=; b=jvf1z5iQg7gyyz/lRtdb+VSDOcpwxCFV+AJ8VXWVekAc9gD4Cr2rZ3HpBg7chpbyYb 1bt4RP3jAbY+BNii+Wyv8+NseE/FaeuBjN1xfFgDdmDcP3ZxMZJChnyyDFktD5T/V82U MujPSbWx5AnT3LG6jClKH5McGCpAZ9W6/ayaOmay3TZRueC2u/XGUztobyKQWa+/d8bV Vm+lMBqrB7sZTkgkTvFNcNzeqjxjnHeSdv2SSZUP+bgOv+bbfVnbs+RgTB3KidKc3g// buCH8bZa0mxft6cu88GBL19aDNR/CPz8IVtNv9LxRojyrjZNjRVIXn6Qp4spDNprIoSr Pfqg== 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; bh=x9HNaFvYROWR/q0WigaQ04GwrP/LdXxab9x3kGA1upY=; b=JZwBs+X1/PQR5HNrvt0VfpnT0vOLaegT9cxQL24K708EPRl6ei7JcqONduVIP+Ht9U FMWZ9FgfvTDBq9yKib8VknQq/AXX3rzMOb9gEz7IoDnCh93QzWxdu4g1qWrEgrNHxtZt cReLJOKTEDzIrg+BC8C4s3ZjYq0LpW2lwwXAIc/hTZPfpQiGZB2s7TM40vNVjn+fT/1E 0L3L3dlLGWKh6B1xbk86oBcEa01FExXyTtuMXIVxCkNZ1lZw0CZeO0gYhr5bEwrdeNOY 74xS2boYWDLN2aB4giC2OT2R6t7nkq7cVkASDKC5ZFpqVRVbF0hWQ1EtHHB/0N6owsOJ 9Ifg== X-Gm-Message-State: AGi0PuY4llr4EZydf+bUHqyqJkDQo+pn7S3Ta7ic981MAi7qqJyYb/VQ Xn514WTgO8i0ml8COtEkUV7e3Oox X-Google-Smtp-Source: APiQypIqkSjgM6UR8vvz2CG8F32XcPE3KrKQFC2Zd5oxZqq7jlLrO63/VhX9yPMRSpyi0WoyOXV+rA== X-Received: by 2002:a17:90a:e02:: with SMTP id v2mr22933748pje.131.1586792627223; Mon, 13 Apr 2020 08:43:47 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id i187sm8912901pfc.112.2020.04.13.08.43.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2020 08:43:45 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Mon, 13 Apr 2020 08:43:21 -0700 Message-Id: <1586792601-78270-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] ofp-actions: Fix memory leak on error path. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Need to free the memory before return. Detected by gcc10. Signed-off-by: William Tu Reviewed-by: Yifeng Sun --- lib/ofp-actions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index ef8b2b4527f9..a94d1a7ca918 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -5966,6 +5966,7 @@ parse_CLONE(char *arg, const struct ofpact_parse_params *pp) clone = pp->ofpacts->header; if (ofpbuf_oversized(pp->ofpacts)) { + free(error); return xasprintf("input too big"); }