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 06845A0547; Thu, 24 Jun 2021 15:25:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB0BC410E4; Thu, 24 Jun 2021 15:25:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 6C710410DD for ; Thu, 24 Jun 2021 15:25:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624541106; 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=5wHfkWtfS6dcrYG9v1Eza2LYH6nnngz79qYa7mE+XXo=; b=NisUGFKfNZXrvF1BSBxIeQybdyqPP1SEuFFiomdnDvIkoBSIK73sE6qmXvtZlsnCbWT7KG bq2lpH8wLGXeS8GTlNM4hZoQB7k/8ulkoyvv6Gqui8bQiQYpkjLsiKMvM8Tn+tlgqiJatX 2OxCemYl7I9+z84UnvLXtm5CpdftJ30= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-Juy2yhmDM3Szzf5_3hicyA-1; Thu, 24 Jun 2021 09:25:05 -0400 X-MC-Unique: Juy2yhmDM3Szzf5_3hicyA-1 Received: by mail-vk1-f198.google.com with SMTP id y75-20020a1f7d4e0000b029024bcc2c4cd3so1900519vkc.17 for ; Thu, 24 Jun 2021 06:25:05 -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=5wHfkWtfS6dcrYG9v1Eza2LYH6nnngz79qYa7mE+XXo=; b=UD3sBSKfK2lBzqckwqcp93WtUX6qeZ3R3FKB1jcgbUlE5Q9+mxYudG0NixTZtCaQE6 wuDUBQESFSDq0Vp98k3cUMsdwIWczjf/msb+Tw+cWQYbkP5xiyBMO6eYvIgxmM/qijqc dUUQF5nV6SOR8F2FAcsXVNzslTvwsSCy4a9ZDn4wveMUUcARdKjL+2OmvBJuUW+uTCN3 9zReVCMRaZOu5j534rnbgRheM5V5FFJtw78x6miL6X08MNA5PhO1+e/sMPXQXJvHsrGv 2+D9JCWEz0BDS2TnppWyZ7S3kHjTUxJmT7wyWOgpFzkvjDko8dBDLJRofiL703RGo1UY mvcw== X-Gm-Message-State: AOAM532lfz5fofUMH/vSMn9YzhcLoqqbOMyZ0XgrK9jiqVXpvzNzcNDc ZL7bY7YPUaTNYAYXgdj8lQ4+hNiGoLIJLF69jVEcM829kJopqUr/c0ROQPJaoa2GG96fkAG1tl2 9rQqGelsxW8jrN4AvC4Q= X-Received: by 2002:a1f:2e86:: with SMTP id u128mr2643195vku.22.1624541104819; Thu, 24 Jun 2021 06:25:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO7pefK50157m+uI0lMalFGDx1KixI7NphkPx8dD7XeXTIhVpn1OrdBy2C4WIB6tij+ppSSUwmv+R9iOhaR8k= X-Received: by 2002:a1f:2e86:: with SMTP id u128mr2643173vku.22.1624541104672; Thu, 24 Jun 2021 06:25:04 -0700 (PDT) MIME-Version: 1.0 References: <20210616180724.355217-1-ohilyard@iol.unh.edu> <20210623180645.91942-1-ohilyard@iol.unh.edu> In-Reply-To: From: David Marchand Date: Thu, 24 Jun 2021 15:24:53 +0200 Message-ID: To: Olivier Matz Cc: Owen Hilyard , dev , dpdk stable 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 v3] tests/cmdline: fix memory leaks 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 Sender: "dev" On Thu, Jun 24, 2021 at 2:08 PM Olivier Matz wrote: > > - if (cmdline_file_new(&ctx, "prompt", "/dev/null") == NULL) { > > + cl = cmdline_file_new(&ctx, "prompt", "/dev/null"); > > + if (cl == NULL) { > > printf("Error: failed to open /dev/null for reading!"); > > + cmdline_free(cl); > > return -1; > > } > > The cmdline_free(cl) after a if (cl == NULL) is not needed. I took the liberty of doing the change when applying and added your ack. Thanks. -- David Marchand