… rather than the private "config_free" function.
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static void config_free(char *var)
-{
- if (var != NULL)
- free(var);
-}
-
static int config_set(char **var, const char *value)
{
- config_free(*var);
+ sfree(*var);
if ((*var = strdup(value)) == NULL)
return (1);
return (0);
static int shutdown(void)
{
- config_free(host);
- config_free(vhost);
- config_free(user);
- config_free(password);
- config_free(exchange);
- config_free(routingkey);
+ sfree(host);
+ sfree(vhost);
+ sfree(user);
+ sfree(password);
+ sfree(exchange);
+ sfree(routingkey);
return (0);
}