bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk: Memory leak in do_match (builtin.c)


From: Aharon Robbins
Subject: Re: gawk: Memory leak in do_match (builtin.c)
Date: Thu, 04 Jan 2007 16:51:48 +0200

Thanks. This is now applied. It'll show up in the public CVS
archive soon.

Arnold

> Date: Thu, 30 Nov 2006 15:25:55 +0100
> From: Sven Wegener <address@hidden>
> Subject: gawk: Memory leak in do_match (builtin.c)
> To: address@hidden
>
> Hi,
>
> please find attached a patch to fix a memory leak in gawk. When using
> the match function in awk and not requesting the array with matches, we
> leak the memory allocated by the multibyte conversion function str2wstr.
>
> Cheers,
> Sven
>
> --=20
> Sven Wegener
> Gentoo Developer
> http://www.gentoo.org/
>
> Index: builtin.c
> ===================================================================
> RCS file: /sources/gawk/gawk-stable/builtin.c,v
> retrieving revision 1.2
> diff -u -r1.2 builtin.c
> --- builtin.c 11 Aug 2006 12:49:39 -0000      1.2
> +++ builtin.c 30 Nov 2006 14:17:56 -0000
> @@ -2089,9 +2089,9 @@
>                       }
> =20
>                       free(buf);
> -                     if (wc_indices != NULL)
> -                             free(wc_indices);
>               }
> +             if (wc_indices != NULL)
> +                     free(wc_indices);
>       } else {                /* match failed */
>               rstart =3D 0;
>               rlength =3D -1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]