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 2FEA0A00C3; Thu, 14 May 2020 09:59:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFDB31D68D; Thu, 14 May 2020 09:59:18 +0200 (CEST) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id C67871D68A for ; Thu, 14 May 2020 09:59:17 +0200 (CEST) Received: by mail-il1-f193.google.com with SMTP id r2so2377384ilo.6 for ; Thu, 14 May 2020 00:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5wnmbDPY1VGJIAvv2aVUbjuEJelRIg4eEfxcv7RQxb8=; b=Qh45eSS2LxIjzycRDoq8lWtuhTzsbD+OduNOz+FphFvIceGBmeUtA/swb/Cy4OYNis XgDWHEZwMR9e+SfxDw+qQ3AdzC/LCRpUD0HsPHXD6pNue/XJYUYypomV7o6QJkjzmTSV 6E3VzfnVNCcHonKNd3YyUbGboSjzBbazc5ASFNBngh0PVuQIO4Sr03vkh5P8T5jG+LRA O73xhOJCHRhj46K3UVh5kawvtO+43EE9bHjqXNtlN+8Af+V6d6hvXV6Js4/7JPx6MxOZ ZlxdCwL7RL5bWfySvDVRA9z4dO7Xb5tBUyBn+iV834/VZJN4bKIIn3BHoJlp5yAPi1Tb eTOA== 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=5wnmbDPY1VGJIAvv2aVUbjuEJelRIg4eEfxcv7RQxb8=; b=pVx2er6TPCy8d2vbr8qdP6N7ecTtpJzx2x0HNxJkqfnxF+3dTJpQDe/AbkPT+N4SnZ Sts9ZQ/HWjYWtZ/8wzSTSp+fiKSN8+yoxSFDXgKAPIR0oTUsquI5khCQW7qY0TansE0T O0PB6D7RI+9NBM1IajBsjeBCsqxzi3pfbxdLGZQ/R8crkUkomhaUnpN0I6wN2cGPwesQ Y10qm5oHbxhbjUa0QHErp007Xk17gf9s/0+aSQbbDzJViB5W889OXgy1WCKpQMrOkm4H b24qwU1XiYyzVlw77pl+BTP95oUgGin6F3I+YghOm36j+QJCPdtXAKc8x2If4gH2DZCF +FxA== X-Gm-Message-State: AOAM533URs8Ynkhfje07U/np3BXfoDN7NYRKR6oTWi/9MrydKVAmoruD pv4TLhobK4SMif6l3v0qzm2nNUpsaTber1KFzx4= X-Google-Smtp-Source: ABdhPJwJkUhyK/TiDM6UVxfixT/8RRWG20l/hElwmPRHoUCl/tUHQkQWyXoqIDCpJyijbwD7GQm1+y48QdmrJbpIHBY= X-Received: by 2002:a05:6e02:1341:: with SMTP id k1mr3480222ilr.162.1589443157106; Thu, 14 May 2020 00:59:17 -0700 (PDT) MIME-Version: 1.0 References: <20200514033140.11340-1-kirankumark@marvell.com> In-Reply-To: <20200514033140.11340-1-kirankumark@marvell.com> From: Jerin Jacob Date: Thu, 14 May 2020 13:29:00 +0530 Message-ID: To: Kiran Kumar K Cc: Jerin Jacob , Nithin Dabilpuram , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] test/graph: fix memory leak 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 Thu, May 14, 2020 at 9:02 AM wrote: > > From: Kiran Kumar K > > Fix memory leaks reported by coverity. Please add Coverity issue: and Fixes: tag > > Signed-off-by: Kiran Kumar K > --- > app/test/test_graph.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/app/test/test_graph.c b/app/test/test_graph.c > index cf6df0744..ed69eda99 100644 > --- a/app/test/test_graph.c > +++ b/app/test/test_graph.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > > #include "test.h" > > @@ -145,7 +146,7 @@ uint16_t > test_node_worker_source(struct rte_graph *graph, struct rte_node *node, > void **objs, uint16_t nb_objs) > { > - uint32_t obj_node0 = rand() % 100, obj_node1; > + uint32_t obj_node0 = rte_rand() % 100, obj_node1; > test_main_t *tm = &test_main; > struct rte_mbuf *data; > void **next_stream; > @@ -193,7 +194,7 @@ test_node0_worker(struct rte_graph *graph, struct rte_node *node, void **objs, > test_main_t *tm = &test_main; > > if (*(uint32_t *)node->ctx == test_node0.id) { > - uint32_t obj_node0 = rand() % 100, obj_node1; > + uint32_t obj_node0 = rte_rand() % 100, obj_node1; > struct rte_mbuf *data; > uint8_t second_pass = 0; > uint32_t count = 0; > @@ -496,6 +497,7 @@ test_lookup_functions(void) > printf("Test number of edges for node = %s failed Expected = %d, got %d\n", > tm->test_node[i].node.name, > tm->test_node[i].node.nb_edges, count); > + free(next_edges); > return -1; > } > > @@ -505,6 +507,7 @@ test_lookup_functions(void) > printf("Edge name miss match, expected = %s got = %s\n", > tm->test_node[i].node.next_nodes[j], > next_edges[j]); > + free(next_edges); > return -1; > } > } > -- > 2.17.1 >