From 6cc3e7999e12be33ba174cd9ab062688f1574814 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 27 May 2014 22:02:52 +0100 Subject: [PATCH] Tidy up. --- src/security_default.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/security_default.c b/src/security_default.c index 4b8ce5ab..27cda771 100644 --- a/src/security_default.c +++ b/src/security_default.c @@ -128,7 +128,7 @@ int _add_acl(struct mosquitto_db *db, const char *user, const char *topic, int a acl_user->acl = NULL; } - acl= _mosquitto_malloc(sizeof(struct _mosquitto_acl)); + acl = _mosquitto_malloc(sizeof(struct _mosquitto_acl)); if(!acl){ _mosquitto_free(local_topic); return MOSQ_ERR_NOMEM; @@ -298,15 +298,14 @@ int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *conte local_acl[len] = '\0'; mosquitto_topic_matches_sub(local_acl, topic, &result); + _mosquitto_free(local_acl); if(result){ if(access & acl_root->access){ /* And access is allowed. */ - _mosquitto_free(local_acl); return MOSQ_ERR_SUCCESS; } } - _mosquitto_free(local_acl); acl_root = acl_root->next; }