From patchwork Wed Oct 28 15:53:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 82670 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6BF13A04DD; Wed, 28 Oct 2020 16:53:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B1447CC78; Wed, 28 Oct 2020 16:53:36 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id B9520CC69 for ; Wed, 28 Oct 2020 16:53:33 +0100 (CET) IronPort-SDR: EHUWMfDJCmQ+HJeRWeAi5vaxhj8lFKbbnlZ6bopiZU14+za8Mj1Fa44jQaLGY3HmwAbwoRXg2S hJEb7v47cXFg== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="229919963" X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="229919963" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2020 08:53:31 -0700 IronPort-SDR: bdUJouuDSSgOPcDmcmPWNfXE/HzBkgptDU1GhgoJULivZMK+Eltwlq0yoSBfHmFnWDroutkph9 /KslkgazpGsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="351052786" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.223.148]) by fmsmga004.fm.intel.com with ESMTP; 28 Oct 2020 08:53:30 -0700 From: Ciara Power To: dev@dpdk.org Cc: Ciara Power , roy.fan.zhang@intel.com, Marko Kovacevic Date: Wed, 28 Oct 2020 15:53:27 +0000 Message-Id: <20201028155327.104488-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] examples/fips_validation: fix resource leak on failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The dst variable went out of scope on failure in the get_writeback_data function. This is now freed before returning -1. Coverity issue: 363453 Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list") Cc: roy.fan.zhang@intel.com Signed-off-by: Ciara Power --- examples/fips_validation/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 07532c9562..be38eb29b6 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -1128,6 +1128,7 @@ get_writeback_data(struct fips_val *val) if (data_len) { RTE_LOG(ERR, USER1, "Error -1: write back data\n"); + free(dst); return -1; }