monit-dev
[Top][All Lists]
Advanced

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

Re: monit CHANGES.txt monit.pod sendmail.c util.c h...


From: Martin Pala
Subject: Re: monit CHANGES.txt monit.pod sendmail.c util.c h...
Date: Sun, 12 Aug 2007 17:53:09 +0200

Good point :) I moved the b64 from the inner block and check/free it on exit ... it should fix the possible leak.

Thanks,
Martin


On Aug 12, 2007, at 2:48 PM, Jan-Henrik Haukeland wrote:


On 12. aug. 2007, at 13.09, Martin Pala wrote:

http://cvs.savannah.gnu.org/viewcvs/monit/sendmail.c? cvsroot=monit&r1=1.48&r2=1.49


There is a potential memory leak in sendmail.c here,

    b64 = encode_base64(len, buffer);
    do_send(&S, "AUTH PLAIN %s\r\n", b64);
    free(b64);

if do_send fails it long jumps and free(b64) will never be called. To avoid this, everything in the block, if(S.username) { auth } could be put in its own do_auth function which calls socket_write directly and frees b64 if write failed. I can fix this, but since you are in the process of preparing a release I thought I should ask first if it is okay, so I don't mess up any code checkin.


_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev





reply via email to

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