All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: "Wei,Jiangang" <weijg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 4/5] kernel/syscalls/dup2: free fildes to avoid memory leak
Date: Thu, 7 May 2015 15:26:11 +0200	[thread overview]
Message-ID: <20150507132611.GF28637@rei.suse.de> (raw)
In-Reply-To: <1430897176-16486-4-git-send-email-weijg.fnst@cn.fujitsu.com>

Hi!
> Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
> ---
>  testcases/kernel/syscalls/dup2/dup205.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/testcases/kernel/syscalls/dup2/dup205.c b/testcases/kernel/syscalls/dup2/dup205.c
> index 14218dd..a77ae0d 100644
> --- a/testcases/kernel/syscalls/dup2/dup205.c
> +++ b/testcases/kernel/syscalls/dup2/dup205.c
> @@ -111,6 +111,7 @@ int main(int ac, char *av[])
>  		unlink(pfilname);
>  		for (ifile = fildes[0]; ifile < min + 10; ifile++)
>  			close(fildes[ifile]);
> +		free(fildes);
>  		if (local_flag == PASSED) {
>  			tst_resm(TPASS, "Test passed.");
>  		} else {

Can you also move the allocation and free outside the TEST_LOOPING loop?

Ideally to the cleanup and setup?

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-05-07 13:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06  7:26 [LTP] [PATCH 1/5] kernel/syscalls/mmap: remove unused cleanup() Wei,Jiangang
2015-05-06  7:26 ` [LTP] [PATCH 2/5] kernel/syscalls/ipc/lib: Don't allocate memory for getpwnam() Wei,Jiangang
2015-05-07 13:21   ` Cyril Hrubis
2015-05-08  3:28     ` [LTP] [PATCH v2 " Wei,Jiangang
2015-05-06  7:26 ` [LTP] [PATCH 3/5] kernel/mem/hugetlb/lib: " Wei,Jiangang
2015-05-07 13:21   ` Cyril Hrubis
2015-05-08  3:31     ` [LTP] [PATCH v2 " Wei,Jiangang
2015-05-08  8:33     ` [LTP] [PATCH v3 3/5] kernel/mem/hugetlb/lib: do refactor for getuserid Wei,Jiangang
2015-05-06  7:26 ` [LTP] [PATCH 4/5] kernel/syscalls/dup2: free fildes to avoid memory leak Wei,Jiangang
2015-05-07 13:26   ` Cyril Hrubis [this message]
2015-05-08  3:33     ` [LTP] [PATCH v2 4/5] kernel/syscalls/dup2: optimize allocation and free Wei,Jiangang
2015-05-06  7:26 ` [LTP] [PATCH 5/5] kernel/syscalls/fallocate: move fclose out of if-block Wei,Jiangang
2015-05-07 13:32   ` Cyril Hrubis
2015-05-08  3:39     ` [LTP] [PATCH v2 5/5] kernel/syscalls/fallocate: adjust fclose's position Wei,Jiangang
2015-05-07 13:22 ` [LTP] [PATCH 1/5] kernel/syscalls/mmap: remove unused cleanup() Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150507132611.GF28637@rei.suse.de \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=weijg.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.