Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oTefM-0000H1-76 for mharc-grub-devel@gnu.org; Thu, 01 Sep 2022 03:31:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTefG-0000Bz-OO for grub-devel@gnu.org; Thu, 01 Sep 2022 03:31:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTefF-0000KT-8o for grub-devel@gnu.org; Thu, 01 Sep 2022 03:31:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662017460; 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: content-transfer-encoding:content-transfer-encoding; bh=B43MeznK7tZGseVCZA70jJyU2CHMbDwpA0AV9GFxNVc=; b=H4CogYjMyaSvYyRj6Kz63eenklzKEQIzBkFGZpAtCRewrWN8usoVIt5IyUw4LIc1JGbq3M /SSW6Ga/2cRRa05ziNUSU3D7I9HjLYDCS33qz8se6VXTrTeyzjt5omk4VxymtYXZOT1rT4 bOn2tKoEJgnBrJc211q1LDMpJQTOhUE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-634-HncyafnRPD6Df1PyotYcOw-1; Thu, 01 Sep 2022 03:29:11 -0400 X-MC-Unique: HncyafnRPD6Df1PyotYcOw-1 Received: by mail-wr1-f71.google.com with SMTP id h3-20020adfa4c3000000b002266f5ef273so2802738wrb.14 for ; Thu, 01 Sep 2022 00:29:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=B43MeznK7tZGseVCZA70jJyU2CHMbDwpA0AV9GFxNVc=; b=UanECMY0SVK94xD2Yn4tDlfrJKgvhoBWiOZ0bSonrzilYOEnmUXb+L55ireagrbICr bvkBChSiDrzZ0q/LvMwokyWU4/xJ0c9XlcbphILvKeSMQIwaA4k/4yc5L2rqjeBFOleU bOvFm1x/Fsbfy4FRN2+1N3XtvIoajReVd6oN/XnhvVyvYHkRK/fu6jINWHj2xXlt5oLx PuBQe+r6PvXKZC5ow8k+qOqJLe8GjpYVl7QuYPre5ekrqVE41S3m2GbIK1KELTqyLaWR capyBTAaMFAmSDzGQQkqeUJvz4jV8wSHwl9we7FWog1CvHziEqZuyxtIiUKcVzPesrDu Ka0w== X-Gm-Message-State: ACgBeo27Wvr8ujukGqpGomJ2oC4PyVv8dOFSeF7ATu93ujChL/qFTpAy Nkd652mbauHb2OLEB/C2wuWY9MSTAUbpQ0ZFDHfE1+6pE/loUfbWyRPCtCyVH9aWK9EQZULH+WD WSHiwhbbrRn6uy9eeXeGhCJEalf/t2zutD6M8g+DOfiOAqV1Ra+wuCIvZJQ+9g6M= X-Received: by 2002:adf:a490:0:b0:225:2da4:10ff with SMTP id g16-20020adfa490000000b002252da410ffmr13838076wrb.1.1662017350216; Thu, 01 Sep 2022 00:29:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vm3tlTEYRuXaCgPOmzrKhHomxgTQcf22V+y5PlqNqMP63CRy8iw88omnmQ14qp0U2HWPnww== X-Received: by 2002:adf:a490:0:b0:225:2da4:10ff with SMTP id g16-20020adfa490000000b002252da410ffmr13838061wrb.1.1662017349945; Thu, 01 Sep 2022 00:29:09 -0700 (PDT) Received: from t590.redhat.com (82-64-217-13.subs.proxad.net. [82.64.217.13]) by smtp.gmail.com with ESMTPSA id b11-20020a05600c4e0b00b003a50924f1c0sm5208303wmq.18.2022.09.01.00.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 00:29:09 -0700 (PDT) From: =?UTF-8?q?Renaud=20M=C3=A9trich?= To: grub-devel@gnu.org Cc: =?UTF-8?q?Renaud=20M=C3=A9trich?= Subject: [PATCH v4 1/2] lsefi: fixed memory leaks Date: Thu, 1 Sep 2022 09:28:53 +0200 Message-Id: <20220901072854.152640-1-rmetrich@redhat.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=rmetrich@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2022 07:31:06 -0000 Signed-off-by: Renaud Métrich --- grub-core/commands/efi/lsefi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c index f46ba3b49..241be79f9 100644 --- a/grub-core/commands/efi/lsefi.c +++ b/grub-core/commands/efi/lsefi.c @@ -136,8 +136,12 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), (unsigned) protocols[j]->data4[7]); } + if (protocols) + grub_efi_free_pool (protocols); } + grub_free (handles); + return 0; } -- 2.37.2