From b2aed5cb7e7bdd52183aa5f75be0231b37d617ca Mon Sep 17 00:00:00 2001 From: YangHau Date: Thu, 1 Aug 2019 11:06:52 +0800 Subject: [PATCH] feat: Remove unecessary if statement free() would take no action if the arguement is a NULL pointer. Therefore, the if statement is totally unnecessary. See ISO-IEC 9899 Signed-off-by: YangHau --- client/client_shared.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/client_shared.c b/client/client_shared.c index 7d3ba773..205245a2 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -1427,11 +1427,11 @@ static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url) return 0; cleanup: - if(username_or_host) free(username_or_host); - if(username) free(username); - if(password) free(password); - if(host) free(host); - if(port) free(port); + free(username_or_host); + free(username); + free(password); + free(host); + free(port); return 1; } #endif