Use new instead of malloc

Using new instead of malloc is required for proper initialization of C++
classes.
This commit is contained in:
Markus Mäkelä
2017-06-12 11:43:48 +03:00
parent c77dcea807
commit f5a0526f2c
3 changed files with 57 additions and 88 deletions

View File

@ -1358,32 +1358,6 @@ handle_got_target(ROUTER_INSTANCE *inst, ROUTER_CLIENT_SES *rses,
}
}
/**
* @brief Create a generic router session property structure.
*
* @param prop_type Property type
*
* @return property structure of requested type, or NULL if failed
*/
rses_property_t *rses_property_init(rses_property_type_t prop_type)
{
rses_property_t *prop;
prop = (rses_property_t *)MXS_CALLOC(1, sizeof(rses_property_t));
if (prop == NULL)
{
return NULL;
}
prop->rses_prop_type = prop_type;
#if defined(SS_DEBUG)
prop->rses_prop_chk_top = CHK_NUM_ROUTER_PROPERTY;
prop->rses_prop_chk_tail = CHK_NUM_ROUTER_PROPERTY;
#endif
CHK_RSES_PROP(prop);
return prop;
}
/**
* @brief Add property to the router client session
*