From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9301F43242; Thu, 2 Nov 2023 23:47:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6510240262; Thu, 2 Nov 2023 23:47:25 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id AFB9840144 for ; Thu, 2 Nov 2023 23:47:23 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1cc1ee2d8dfso13042485ad.3 for ; Thu, 02 Nov 2023 15:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1698965243; x=1699570043; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=l3kJxpRSsTpseRfYviBhIOy/gYNYS0eTa84Ji+I6y1o=; b=LQTvbjXHlNB4ff4i+9niLvsPs9dJGbg0K4RXMb2Ug/My0oNxAi4PoLxkbDSwwx5Q9h 3I4hP1lrcqHl35Z5ND3xSndjR/gFgEbc6GebJQdT8PiSxlWBkNJ9uDxmaT69kJZpfNBy XXjDywPXdeOam2JWM0Q/h5b7bQjH/1Z40V5ZrCFBbhCpTAgAT2QXm6fWeRXvRH/UNZ10 7wnf3nJE9/pFh7kXRmTfsIXVUKfbncWVkH7mu4i2nRocu32xC/8cqyUwleiO4GXbL8n9 Zg7rLjO0dr3S7yMI2aS0GdKNxMD+iP+NG9cziEk6WpZeDDSLzUgsBvSeNeQudBpsbWrf wTnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698965243; x=1699570043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l3kJxpRSsTpseRfYviBhIOy/gYNYS0eTa84Ji+I6y1o=; b=BXAHJaS88qU2jm89zF61e8n3xp1S/UHuAWo2DcnLwiiIo5E/EsaF17/j8Phmei3xHv Ybo2x1mlxzTYePOEP6k93zln+gqNKirLY3Z1KP08M66mJ1bthKqEoJKHQY86SQhHTz1B sVGbiTbWl4/JNEXndUTjVNuDIRJmRVkWSC5jncJbmU6zeAy2HyWlxQBViNMQC7kaZZr/ zfUevGgfOol7W9gh3inzUqvr30GzBK85L4tYgs+nGh8/gXeevrJHpIx7inmDQ3/unLZv B/u5aj3qBXQBicaayUN7U6zjWRaKSS3Nx/huThgyFBi5oQ9dUn19tufot2ZgUfO79zRL JYjA== X-Gm-Message-State: AOJu0Yw7s4yXil71exS3IH69vzVsDTdPuC+8S/6mEAZXoWV2oHCul/yw QS5s9gneOOWihAd7H8oczNKooQ== X-Google-Smtp-Source: AGHT+IHJ3hWhnhgXdFmSRRyECmMUrDnqTiJMpYN8fZJnZIOPARI5t69kqrUAMNsrmDry5/yX4tWIuA== X-Received: by 2002:a17:902:d512:b0:1cc:431f:55e6 with SMTP id b18-20020a170902d51200b001cc431f55e6mr17113932plg.63.1698965242810; Thu, 02 Nov 2023 15:47:22 -0700 (PDT) Received: from fedora ([38.142.2.14]) by smtp.gmail.com with ESMTPSA id d13-20020a170902cecd00b001b9d335223csm208830plg.26.2023.11.02.15.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:47:22 -0700 (PDT) Date: Thu, 2 Nov 2023 15:47:18 -0700 From: Stephen Hemminger To: Gowrishankar Muthukrishnan Cc: , , Akhil Goyal , Kai Ji , Ciara Power Subject: Re: [PATCH v2] crypto/openssl: fix memory leaks in asym ops Message-ID: <20231102154718.74272c0d@fedora> In-Reply-To: <83522013646bcd96b2420b3f69b74255981b3a20.1698913776.git.gmuthukrishn@marvell.com> References: <20230919130412.284-1-gmuthukrishn@marvell.com> <83522013646bcd96b2420b3f69b74255981b3a20.1698913776.git.gmuthukrishn@marvell.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 2 Nov 2023 14:08:31 +0530 Gowrishankar Muthukrishnan wrote: > + if (pub_key) > + BN_free(pub_key); > + if (pkey) > + EVP_PKEY_free(pkey); > All these checks for null are unnecessary: EVP_PKEY_free() decrements the reference count of key and, if the reference count is zero, frees it up. If key is NULL, nothing is done. Let me add those functions to cocci nullfree script as well.