[Vortex] Bug in vortex_alive.c (vortex-1.1.6.b4526.g4526)

Gernot Seidler gseidler at egenera.com
Thu Oct 28 07:54:13 CEST 2010


Hi,



I am evaluating the vortex alive feature, which was broken until the latest
release.

Thanks for the fix!!!!



I think I found another, but minor bug:

In vortex_alive_enable_check(…)

axl_bool           vortex_alive_enable_check               (VortexConnection
* conn,

                                                    *long*
check_period,

                                                    *int*
max_unreply_count,

                                                    VortexAliveFailure
failure_handler)

{

       VortexAliveData * data;

       VortexCtx        * ctx = CONN_CTX (conn);



       *if* (check_period <= 0 || max_unreply_count < 0) {

              vortex_log (VORTEX_LEVEL_CRITICAL, "Expecified an unsupported
check period or max unreply count. Both must be > 0.");

              *return* axl_false;

       }



       /* check if the connection is already checked */

       *if* (PTR_TO_INT (vortex_connection_get_data
(conn,VORTEX_ALIVE_CHECK_ENABLED
))) {

              vortex_log (VORTEX_LEVEL_WARNING, "Calling to enable
connection alive check where it is already enabled");

              *return* axl_false;

       } /* end if */



       /* check to get a reference to the connection */

       data       = axl_new (VortexAliveData, 1);

       *if* (data == NULL) {

              vortex_log (VORTEX_LEVEL_CRITICAL, "failed to acquire memory
to hold VortexAliveData, unable to continue");

              *return* axl_false;

       }

       data->conn              = conn;

       data->failure_handler   = failure_handler;

       data->max_unreply_count = max_unreply_count;

       data->check_period      = check_period;



       *if* (! vortex_connection_ref (conn, "alive-check")) {

              vortex_log (VORTEX_LEVEL_CRITICAL, "Failed to enable alive
check, connection reference acquisition have failed");

BUG:>>>> Memory leak: data pointer should be freed here.

              *return* axl_false;

       }







Gernot Seidler
Software Architect

*Egenera Inc. | Converge. Unify. Simplify.™ *

508-858-3185 (office)
508-481-3114 (fax)

*http:*//www.egenera.com
 <http://www.egenera.com/>http://blog.egenera.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aspl.es/pipermail/vortex/attachments/20101028/fbf95366/attachment.htm>


More information about the Vortex mailing list