[Lognorm] Memory Leak in liblognorm?

Rainer Gerhards rgerhards at hq.adiscon.com
Mon Jul 15 22:05:21 CEST 2013


Ok thx.  Than i need to check the API  spec.  I have seen that the web doc
is pretty old and missing functions - hopefully only the web...

Sent from phone, thus brief.
Am 15.07.2013 22:02 schrieb "Champ Clark III" <cclark at quadrantsec.com>:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Sorry,  but same results :(   I'm using the same test code below but with
> es_emptyStr(str) replaced with es_deleteStr(str)
>
>
>
> On 07/15/2013 03:46 PM, Rainer Gerhards wrote:
> >
> > Use es_deleteStr instead of es_emptyStr. The latter just resets it but
> does not free.  More explanations follow tomorrow.  Please report back.
> >
> > Sent from phone, thus brief.
> >
> > Am 15.07.2013 21:06 schrieb "Champ Clark III" <cclark at quadrantsec.com
> <mailto:cclark at quadrantsec.com> <cclark at quadrantsec.com>>:
> >
> >
> >
> > Hello,
> >
> > So - I've stripped down the code a good bit to see if I can't isolate
> > where I'm going wrong.  Below is what I got:
> >
> > --<snip>--
> > str = es_newStrFromCStr(syslog_msg, strlen(syslog_msg));
> > ln_normalize(ctx, str, &lnevent);
> >
> >        if(lnevent != NULL) {
> >                 es_emptyStr(str);
> >                 ee_fmtEventToRFC5424(lnevent, &str);
> >                 }
> >
> > free(cstr);
> > es_deleteStr(str);
> > ee_deleteEvent(lnevent);
> > }
> > --<snip>--
> >
> > It appears as soon as I add the "ee_fmtEventToRFC5424",  valgrind starts
> > to report the following:
> >
> > ==21979== 69,872 bytes in 614 blocks are definitely lost in loss record
> > 52 of 54
> > ==21979==    at 0x4C2B6CD: malloc (in
> > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> > ==21979==    by 0x5457CD9: es_newStr (string.c:105)
> > ==21979==    by 0x5457D0E: es_newStrFromCStr (string.c:125)
> > ==21979==    by 0x40C167: sagan_normalize_liblognorm
> > (sagan-liblognorm.c:103)
> > ==21979==    by 0x41427F: Sagan_Blacklist (sagan-blacklist.c:167)
> > ==21979==    by 0x40BC07: Sagan_Processor (sagan-processor.c:123)
> > ==21979==    by 0x595EE99: start_thread (pthread_create.c:308)
> >
> > If I remove the line,  that goes away.    Any thoughts?
> >
> > Thanks for your time.
> >
> >
> >     _______________________________________________
> >     Lognorm mailing list
> >     Lognorm at lists.adiscon.com <mailto:Lognorm at lists.adiscon.com><Lognorm at lists.adiscon.com>
> >     http://lists.adiscon.net/mailman/listinfo/lognorm
> >
> >
> >
> > _______________________________________________
> > Lognorm mailing list
> > Lognorm at lists.adiscon.com
> > http://lists.adiscon.net/mailman/listinfo/lognorm
>
> - --
> - - Quadrant Information Security
>   Champ Clark III
>   o: 800.538.9357 x 101
>   c: 850.443.2440
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJR5FVtAAoJENnmXt7Lmc3K6kQH/j1eiHNggCJMRys8vkiEeKme
> evsfBZpTzlw7iTJFsHv/d3vBJub9dcm80y8kgYvmYOrjSea+GIWYKP8a1Ij44b/x
> fwd6QQYzRQ0VZljCFTbW+1xAczzaqTiaJyd4lljG3ecu7BFGG61FwWkr91DU+S1L
> DjhqAONjitYvJC4ZdHNoDfBuodBLTT0qr/BHtbYFDFCYfsIK8+7aSPw3PO6sFM/5
> rjGDXOcXYXZ8niPUorR0CdNekaqzUC5nwj3hUJBYWlw23FTzQfBuI+rIj2IfNl8Z
> 6LIJXtfpbGt9z0eHOwnVRbytGKgOWheX2o27DGHSlcy41myIixgTZ6We2yNGk/s=
> =Ukse
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Lognorm mailing list
> Lognorm at lists.adiscon.com
> http://lists.adiscon.net/mailman/listinfo/lognorm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.adiscon.net/pipermail/lognorm/attachments/20130715/40b5586d/attachment.htm>


More information about the Lognorm mailing list