Hi,
> -----Original Message-----
> From: dev [mailto:[email protected]] On Behalf Of Roman Korynkevych
> Sent: Friday, May 5, 2017 3:47 PM
> To: [email protected]
> Cc: Van Haaren, Harry <[email protected]>; Tahhan, Maryam
> <[email protected]>; Korynkevych, RomanX
> <[email protected]>; [email protected]
> Subject: [dpdk-dev] [PATCH v1 1/1] app/procinfo: resource leak fix.
>
> Coverity issue: 143256
> Fixes: 2deb6b5246d7706448d070335b329d1acb754cee ("app/procinfo: add
> collectd format and host id")
> Cc: [email protected]
>
> Signed-off-by: Roman Korynkevych <[email protected]>
> ---
> app/proc_info/main.c | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/app/proc_info/main.c b/app/proc_info/main.c index
> 17a1c87..3d0b621 100644
> --- a/app/proc_info/main.c
> +++ b/app/proc_info/main.c
1)You need to close the stdout_fd even inside proc_info_preparse_args() before
return -1;
(or)
inside below piece of code in main().
ret = proc_info_preparse_args(argc, argv);
if (ret < 0) {
printf("Failed to parse arguments\n");
return -1;
}
2)Also if stdout_fd = dup(STDOUT_FILENO); can return negative value, You may
need to exit then? If so can you fix that code as well.
Thanks,
Reshma