All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco RUNDO <francesco.rundo@st.com>
To: LTP <ltp-list@lists.sourceforge.net>
Subject: [LTP] mtest01: free memory allocated
Date: Mon, 04 Jan 2010 13:55:57 +0100	[thread overview]
Message-ID: <4B41E55D.2020801@st.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

Hi All,

I'm running LTP (I'm using ltp-full-20090731....but asap I will upgrade 
to latest)  on SH based platforms.
Now, during a test-session. I've noted that the test "mtest01" reduced 
drastically the system memory and after its execution this memory wasn't 
de-allocated.

I've analysed the mtest01.c code and I've noted that no "free()" 
istruction was associated to the related malloc:

......
if((mem = (char*)malloc(chunksize)) == NULL) {
......

I've simply added a "free(mem)" of the allocated memory and the issue 
was addressed successfully.

I've attached the trivial patch I've developed.

Best Regards,
--
Francesco

[-- Attachment #2: ltp-full-20090731-fix-mtest01_memory_issue.patch --]
[-- Type: text/plain, Size: 477 bytes --]

Added missed "free" istruction to release memory previosuly allocated.
Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
--- ltp-full-20090731/testcases/kernel/mem/mtest01/mtest01.c.origin	2009-02-26 13:02:27.000000000 +0100
+++ ltp-full-20090731/testcases/kernel/mem/mtest01/mtest01.c	2009-12-15 14:03:28.779240000 +0100
@@ -258,5 +258,8 @@
     else
       tst_resm(TPASS, "%llu kbytes allocated only.", original_maxbytes/1024);
   }
+
+  free(mem);
+  
   exit(0);
 }

[-- Attachment #3: Type: text/plain, Size: 390 bytes --]

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2010-01-04 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 12:55 Francesco RUNDO [this message]
2010-01-05  2:10 ` [LTP] mtest01: free memory allocated Garrett Cooper
2010-01-05  2:18   ` Li Zefan
2010-01-07 11:36   ` Subrata Modak
2010-01-07 17:50     ` Garrett Cooper
2010-01-11 13:50     ` Francesco RUNDO
2010-01-06  1:19 ` Jiri Palecek
2010-01-06  1:28   ` Henry Yei
2010-01-07  1:47     ` Jiri Palecek

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=4B41E55D.2020801@st.com \
    --to=francesco.rundo@st.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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.