From 0ee0ac98af046bdf2a4000b43e5dedc4a61e9d73 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 22 Mar 2010 20:00:17 +0100 Subject: [PATCH] =?utf8?q?amqp=20plugin:=20Use=20the=20global=20(and=20wid?= =?utf8?q?ely=20used)=20"sfree"=20macro=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … rather than the private "config_free" function. --- src/amqp.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/amqp.c b/src/amqp.c index 95cded7a..1767b85f 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -62,15 +62,9 @@ static const char *config_keys[] = 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); @@ -177,12 +171,12 @@ static int amqp_write(const data_set_t *ds, const value_list_t *vl, user_data_t 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); } -- 2.30.2