Re: [libnftables PATCH] xml: expr: fix mem leak in the expr parser

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

 



Hi Arturo,

On Mon, Aug 12, 2013 at 02:33:35PM +0200, Arturo Borrero Gonzalez wrote:
> There was several mem leaks as reported by valgrind:
> 
> ==23503== 3 bytes in 1 blocks are definitely lost in loss record 1 of 44
> ==23503==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
> ==23503==    by 0x56F1B41: strdup (strdup.c:43)
> ==23503==    by 0x4E3BE62: nft_rule_expr_exthdr_xml_parse (exthdr.c:212)
> ==23503==    by 0x4E3909A: nft_mxml_expr_parse (mxml.c:49)
> ==23503==    by 0x4E368CC: nft_rule_parse (rule.c:581)
> ==23503==    by 0x401462: main (nft-parsing-test.c:255)
> 
> So, once those string are used, do a free.

I have fixed this in a different way. Most callers don't seem to need
the string duplication, therefore, I decided to remove it. We save the
many free invocations that your patch needed. We save some lines of
code.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux