public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: manjeet.p@samsung.com,
	"ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Cc: "ajeet.y@samsung.com" <ajeet.y@samsung.com>,
	AKHILESH KUMAR <akhilesh.k@samsung.com>
Subject: Re: [LTP] [PATCH]: Fix memory leak by freeing buf
Date: Fri, 19 Jun 2015 15:20:52 +0300	[thread overview]
Message-ID: <55840924.2090404@oracle.com> (raw)
In-Reply-To: <55840688.1010202@oracle.com>


On 06/19/2015 03:09 PM, Alexey Kodanev wrote:
> Hi!
> On 06/19/2015 02:25 PM, Manjeet Pawar wrote:
>> From: Manjeet Pawar <manjeet.p@samsung.com>
>> Date: Fri, 19 Jun 2015 16:45:54 +0530
>> Subject: [PATCH] testcases/open_posix_testsuite/functional/semaphores: Fix memory leak by freeing buf
>>
>> This patch fix memory leak by freeing memory leak before function return
>>
>> Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
>> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com>
>> ---
>>    .../functional/semaphores/sem_conpro.c             |    5 +++++
>>    1 file changed, 5 insertions(+)
>>
>> diff --git a/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c b/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
>> index f5f1abf..f3a4cfb 100644
>> --- a/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
>> +++ b/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
>> @@ -106,19 +106,23 @@ int main(int argc, char *argv[])
>>    
>>    #ifndef  _POSIX_SEMAPHORES
>>    	printf("_POSIX_SEMAPHORES is not defined \n");
>> +	free(buf);
>>    	return PTS_UNRESOLVED;
>>    #endif
>>    	if (-1 == sem_init(&(buf->occupied), shared, occupied_value)) {
>>    		perror("sem_init didn't return success \n");
>>    		printf("hello \n");

Also, do you know why it prints "hello"? It should be removed I guess.

Thanks,
Alexey

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

  reply	other threads:[~2015-06-19 12:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 11:25 [LTP] [PATCH]: Fix memory leak by freeing buf Manjeet Pawar
2015-06-19 12:09 ` Alexey Kodanev
2015-06-19 12:20   ` Alexey Kodanev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-28  4:44 Manjeet Pawar
2015-06-01 14:49 ` 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=55840924.2090404@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=ajeet.y@samsung.com \
    --cc=akhilesh.k@samsung.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=manjeet.p@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox