From: Volker Lendecke Date: Sun, 24 Jan 2021 14:40:11 +0000 (+0100) Subject: epmapper: Simplify endpoints_match() X-Git-Tag: tevent-0.11.0~1873 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38ebfe2e1f16909700c60281f28d374448f0b801;p=thirdparty%2Fsamba.git epmapper: Simplify endpoints_match() strequal() deals fine with either string being NULL. We only have to take of the case where both are NULL. Signed-off-by: Volker Lendecke Reviewed-by: Samuel Cabrero --- diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index 6164e221ca0..f407e1a4a0e 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -158,29 +158,13 @@ static bool endpoints_match(const struct dcerpc_binding *b1, return false; } - if (!ep1 && ep2) { - return false; - } - - if (ep1 && !ep2) { - return false; - } - - if (ep1 && ep2) { + if ((ep1 != NULL) || (ep2 != NULL)) { if (!strequal(ep1, ep2)) { return false; } } - if (!h1 && h2) { - return false; - } - - if (h1 && !h2) { - return false; - } - - if (h1 && h2) { + if ((h1 != NULL) || (h2 != NULL)) { if (!strequal(h1, h2)) { return false; }