Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-30 Thread René Scharfe
Am 30.07.19 um 02:08 schrieb Carlo Arenas: > On Mon, Jul 29, 2019 at 1:35 PM René Scharfe wrote: >> >> Am 28.07.19 um 03:41 schrieb Carlo Arenas: >>> On Sat, Jul 27, 2019 at 4:48 PM Ævar Arnfjörð Bjarmason >>> wrote: > + free((void *)p->pcre_tables); Is the cast really needed? I

Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-29 Thread Carlo Arenas
On Mon, Jul 29, 2019 at 1:35 PM René Scharfe wrote: > > Am 28.07.19 um 03:41 schrieb Carlo Arenas: > > On Sat, Jul 27, 2019 at 4:48 PM Ævar Arnfjörð Bjarmason > > wrote: > >>> + free((void *)p->pcre_tables); > >> > >> Is the cast really needed? I'm rusty on the rules, removing it from the > >

Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-29 Thread René Scharfe
Am 28.07.19 um 03:41 schrieb Carlo Arenas: > On Sat, Jul 27, 2019 at 4:48 PM Ævar Arnfjörð Bjarmason > wrote: >>> + free((void *)p->pcre_tables); >> >> Is the cast really needed? I'm rusty on the rules, removing it from the >> pcre_free() you might have copied this from produces a warning for

Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-27 Thread Carlo Arenas
On Sat, Jul 27, 2019 at 4:48 PM Ævar Arnfjörð Bjarmason wrote: > > + free((void *)p->pcre_tables); > > Is the cast really needed? I'm rusty on the rules, removing it from the > pcre_free() you might have copied this from produces a warning for me, > but not for free() itself. This is on GCC 8.

Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-27 Thread Ævar Arnfjörð Bjarmason
On Sat, Jul 27 2019, Carlo Marcelo Arenas Belón wrote: > Just as it is done with PCRE1, make sure that the allocated chartables > get free at cleanup time. > > This assumes no global context is used (NULL passed when created the > tables), but will likely be updated in tandem if that ever change

[PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-27 Thread Carlo Marcelo Arenas Belón
Just as it is done with PCRE1, make sure that the allocated chartables get free at cleanup time. This assumes no global context is used (NULL passed when created the tables), but will likely be updated in tandem if that ever changes. Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 1 + 1