]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
epmapper: Simplify endpoints_match()
authorVolker Lendecke <vl@samba.org>
Sun, 24 Jan 2021 14:40:11 +0000 (15:40 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Jan 2021 16:58:35 +0000 (16:58 +0000)
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 <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
source3/rpc_server/epmapper/srv_epmapper.c

index 6164e221ca0bb3dafd4ca880b083a8ebd84ad50c..f407e1a4a0ec9c00995a4acb2af38670da207e62 100644 (file)
@@ -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;
                }