From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 213FDA04DE; Fri, 30 Oct 2020 14:09:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0420AC920; Fri, 30 Oct 2020 14:09:19 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 504DAC91C for ; Fri, 30 Oct 2020 14:09:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604063354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6RpFURhQp+Lt5X0Gg2eHQfFBwMadmoAcwL4JzC9wTYU=; b=P7QLHsTBTFjCYwNeYMedC5Esh6zNutxyhaBc/5JgQZq715zQqXfQTq62xPbF8UTvlQPZwF iCHK2p2UCHE3WesgMlXr5j7cz8zt8wIByTFrN2r4ULhSI+59r0k/4xBdiWm8j0Foy/K34k E1IfXx+wLkXJnpnvFEaT1w7MWiAP6gg= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-fvvaQuYlMe2m_qWnILrG0Q-1; Fri, 30 Oct 2020 09:09:11 -0400 X-MC-Unique: fvvaQuYlMe2m_qWnILrG0Q-1 Received: by mail-vs1-f72.google.com with SMTP id s2so1540125vsj.21 for ; Fri, 30 Oct 2020 06:09:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6RpFURhQp+Lt5X0Gg2eHQfFBwMadmoAcwL4JzC9wTYU=; b=RPUHb8nGbIGCPOzFbU3e8uM5dFxe/kDqS88KV0zcvinp2lRb72OzpktLXRpCwVX38V n+cKFQnUq3qQ/0mBdpv5EgZC2+iM4E0Uc4IRu0p5fSBiuAzOkRBYOM6mRanI/YyNtokv JsgfINgy51uoFufPx5Jb4+D0rrd9LuP03WGGr/ShaYzzA30eRuRb6q23pBT/W/B9LLPd lltzU/VQeDkqsd3OLKHxWVBOOFAXeq71pwgml2nPRF9Y6KTC+6LcKGUBIsCQePR3rKKS KrD5mdKVDtoLW4y0kijS8sadgPv48SI7CGonZIYXYTir2Jh80lp5ikc02KU1EgRkptS+ kqtw== X-Gm-Message-State: AOAM533Cl29kZxcKE8NaKrMOoF/xOx577dra89vypJPM4zELxTvxyGhN T9Dk54AXseENzJt9EkJEMD7AOhvXIA297uRI9iHKILUeIic8QOl5dlYkDJFDgWixe8Jc8xpLeAT kc+MN0bJ24hPaGxHAai4= X-Received: by 2002:a1f:38d2:: with SMTP id f201mr6661940vka.17.1604063350964; Fri, 30 Oct 2020 06:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxInzNucqZJj1aVKIG9iaDVxEVxkjgUzbQ+jHbMMi0AipR8p9qIR4Bkn0tRPr8EWdC6dKIR9KGl60GRA/DRN4= X-Received: by 2002:a1f:38d2:: with SMTP id f201mr6661801vka.17.1604063349701; Fri, 30 Oct 2020 06:09:09 -0700 (PDT) MIME-Version: 1.0 References: <20201028155327.104488-1-ciara.power@intel.com> In-Reply-To: <20201028155327.104488-1-ciara.power@intel.com> From: David Marchand Date: Fri, 30 Oct 2020 14:08:58 +0100 Message-ID: To: Ciara Power Cc: dev , Fan Zhang , Marko Kovacevic Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Wed, Oct 28, 2020 at 4:53 PM Ciara Power wrote: > > 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); Hum should we instead free the pointer to the allocated buffer, i.e. wb_data, rather than dst that got potentially incremented? -- David Marchand