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 <vulxj0j8j8@gmail.com>
pull/1600/head
YangHau 6 years ago committed by Roger A. Light
parent 06024700ba
commit 3d25b20eba

@ -1427,11 +1427,11 @@ static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url)
return 0; return 0;
cleanup: cleanup:
if(username_or_host) free(username_or_host); free(username_or_host);
if(username) free(username); free(username);
if(password) free(password); free(password);
if(host) free(host); free(host);
if(port) free(port); free(port);
return 1; return 1;
} }
#endif #endif

Loading…
Cancel
Save