9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] test(1) -older bug?
Date: Sun,  2 Jun 2013 23:44:11 -0400	[thread overview]
Message-ID: <f9e98d63a812ffcfacc8863f84ccecb0@brasstown.quanstro.net> (raw)
In-Reply-To: <a0a1de4b257a1108b4897608b09c4b92@gmx.de>

On Sun Jun  2 17:31:05 EDT 2013, cinap_lenrek@gmx.de wrote:
> its /n/sources/patch/testolder, also leaks dir in the case:
>
> 	if(rel)
> 		n = time(0) - n;
> 	if(n < 0)
> 		return 0; <----- HERE
> 	r = dir->mtime < n;
>
> 	free(dir);
> 	return r;

thanks.  i appreciate the catch.

[sources] applied patch: /n/atom/patch/applied/testolder1

email
	quanstro@quanstro.net
readme
	fix memory leak pointed out by cinap
removed

files
	/sys/src/cmd/test.c	test.c

/sys/src/cmd/test.c	test.c
test.c.orig:373,380 - test.c:373,381
  	if(rel)
  		n = time(0) - n;
  	if(n < 0)
- 		return 0;
- 	r = dir->mtime < n;
+ 		r =  0;
+ 	else
+ 		r = dir->mtime < n;

  	free(dir);
  	return r;
------
merge...backup...copy...
cpfile test.c /n/dist/sys/src/cmd/test.c
done




  reply	other threads:[~2013-06-03  3:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01 21:15 arisawa
2013-06-01 21:59 ` erik quanstrom
2013-06-02 21:29   ` cinap_lenrek
2013-06-03  3:44     ` erik quanstrom [this message]
2013-06-03 10:47       ` Richard Miller
2013-06-03 11:00         ` arnold
2013-06-03 13:02           ` erik quanstrom
2013-06-03 11:08         ` Jacob Todd
2013-06-03 11:12           ` Richard Miller

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=f9e98d63a812ffcfacc8863f84ccecb0@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).