[Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: heartbeat by sunjd
from
Lars Marowsky-Bree
lmb at suse.de
Fri Sep 3 03:53:34 MDT 2004
On 2004-09-01T09:43:51,
linux-ha-cvs at lists.community.tummy.com said:
> linux-ha CVS committal
>
> Author : sunjd
> Host :
> Project : linux-ha
> Module : heartbeat
>
> Dir : linux-ha/heartbeat
>
>
> Modified Files:
> hb_api.c
>
>
> Log Message:
> minor fix to avoid severe memory leak ;-)
>
> ===================================================================
> RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_api.c,v
> retrieving revision 1.109
> retrieving revision 1.110
> diff -u -3 -r1.109 -r1.110
> --- hb_api.c 31 Aug 2004 21:45:01 -0000 1.109
> +++ hb_api.c 1 Sep 2004 09:43:51 -0000 1.110
> @@ -1,4 +1,4 @@
> -/* $Id: hb_api.c,v 1.109 2004/08/31 21:45:01 alan Exp $ */
> +/* $Id: hb_api.c,v 1.110 2004/09/01 09:43:51 sunjd Exp $ */
> /*
> * hb_api: Server-side heartbeat API code
> *
> @@ -1071,7 +1071,10 @@
> }
> api_send_client_msg(client, resp);
> /* What to do with 'resp'. Do we need it any more?? FIXME!! */
> + /* I think we don't need it anymore when go here, or memory leak
> + will be very severe. You don't test it;-)
> goto del_msg;
> + */
>
> del_rsp_and_msg:
> if (resp != NULL) {
I'm pretty convinced this bugfix is wrong and creates memory corruption.
_If_ the message has been send successfully, the IPC library will
eventually free() it itself.
The caller is only supposed to free() received messages.
Sincerely,
Lars Marowsky-Brée <lmb at suse.de>
--
High Availability & Clustering \\\ ///
SUSE Labs, Research and Development \honk/
SUSE LINUX AG - A Novell company \\//
More information about the Linux-HA-Dev
mailing list