Re: less(1): plug memory leak

2017-05-03 Thread Todd C. Miller
On Wed, 03 May 2017 08:03:06 +0200, Anton Lindqvist wrote:

> On Mon, May 01, 2017 at 01:36:51PM +0100, Nicholas Marriott wrote:
> > 
> > looks good, ok nicm
> 
> Anyone willing to commit?

Committed.

 - todd



Re: less(1): plug memory leak

2017-05-02 Thread Anton Lindqvist
On Mon, May 01, 2017 at 01:36:51PM +0100, Nicholas Marriott wrote:
> 
> looks good, ok nicm

Anyone willing to commit?

> On Mon, May 01, 2017 at 10:35:59AM +0200, Tobias Stoeckmann wrote:
> > Hi,
> > 
> > On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wrote:
> > > While freeing tag entries, make sure to free the copied strings.
> > 
> > this patch looks good to me.
> > 
> > Have you reported this to the upstream less maintainers, as well?
> > The original less and the forked one from Garrett D'Amore, which we
> > use as foundation, have the same issue in them.
> > 
> > 
> > Tobias
> > 
> > > Index: tags.c
> > > ===
> > > RCS file: /cvs/src/usr.bin/less/tags.c,v
> > > retrieving revision 1.18
> > > diff -u -p -r1.18 tags.c
> > > --- tags.c17 Sep 2016 15:06:41 -  1.18
> > > +++ tags.c30 Apr 2017 18:13:24 -
> > > @@ -77,6 +77,8 @@ cleantags(void)
> > >*/
> > >   while ((tp = taglist.tl_first) != TAG_END) {
> > >   TAG_RM(tp);
> > > + free(tp->tag_file);
> > > + free(tp->tag_pattern);
> > >   free(tp);
> > >   }
> > >   curtag = NULL;
> > > 
> > 
> 



Re: less(1): plug memory leak

2017-05-01 Thread Nicholas Marriott

looks good, ok nicm


On Mon, May 01, 2017 at 10:35:59AM +0200, Tobias Stoeckmann wrote:
> Hi,
> 
> On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wrote:
> > While freeing tag entries, make sure to free the copied strings.
> 
> this patch looks good to me.
> 
> Have you reported this to the upstream less maintainers, as well?
> The original less and the forked one from Garrett D'Amore, which we
> use as foundation, have the same issue in them.
> 
> 
> Tobias
> 
> > Index: tags.c
> > ===
> > RCS file: /cvs/src/usr.bin/less/tags.c,v
> > retrieving revision 1.18
> > diff -u -p -r1.18 tags.c
> > --- tags.c  17 Sep 2016 15:06:41 -  1.18
> > +++ tags.c  30 Apr 2017 18:13:24 -
> > @@ -77,6 +77,8 @@ cleantags(void)
> >  */
> > while ((tp = taglist.tl_first) != TAG_END) {
> > TAG_RM(tp);
> > +   free(tp->tag_file);
> > +   free(tp->tag_pattern);
> > free(tp);
> > }
> > curtag = NULL;
> > 
> 



Re: less(1): plug memory leak

2017-05-01 Thread Anton Lindqvist
Hi,

On Mon, May 01, 2017 at 10:35:59AM +0200, Tobias Stoeckmann wrote:
> Hi,
> 
> On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wrote:
> > While freeing tag entries, make sure to free the copied strings.
> 
> this patch looks good to me.
> 
> Have you reported this to the upstream less maintainers, as well?
> The original less and the forked one from Garrett D'Amore, which we
> use as foundation, have the same issue in them.

Already reported to Garrett[1]. I will make sure to submit it to the
original as well.

[1] https://github.com/gdamore/less-fork/pull/38



Re: less(1): plug memory leak

2017-05-01 Thread Tobias Stoeckmann
Hi,

On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wrote:
> While freeing tag entries, make sure to free the copied strings.

this patch looks good to me.

Have you reported this to the upstream less maintainers, as well?
The original less and the forked one from Garrett D'Amore, which we
use as foundation, have the same issue in them.


Tobias

> Index: tags.c
> ===
> RCS file: /cvs/src/usr.bin/less/tags.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 tags.c
> --- tags.c17 Sep 2016 15:06:41 -  1.18
> +++ tags.c30 Apr 2017 18:13:24 -
> @@ -77,6 +77,8 @@ cleantags(void)
>*/
>   while ((tp = taglist.tl_first) != TAG_END) {
>   TAG_RM(tp);
> + free(tp->tag_file);
> + free(tp->tag_pattern);
>   free(tp);
>   }
>   curtag = NULL;
> 



less(1): plug memory leak

2017-05-01 Thread Anton Lindqvist
Hi,
While freeing tag entries, make sure to free the copied strings.

Index: tags.c
===
RCS file: /cvs/src/usr.bin/less/tags.c,v
retrieving revision 1.18
diff -u -p -r1.18 tags.c
--- tags.c  17 Sep 2016 15:06:41 -  1.18
+++ tags.c  30 Apr 2017 18:13:24 -
@@ -77,6 +77,8 @@ cleantags(void)
 */
while ((tp = taglist.tl_first) != TAG_END) {
TAG_RM(tp);
+   free(tp->tag_file);
+   free(tp->tag_pattern);
free(tp);
}
curtag = NULL;