TODO talloc: fix compiler warning
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Nov 2013 08:58:09 +0000 (09:58 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2014 23:04:36 +0000 (00:04 +0100)
Make it explicit that we exit the loop on depth == 0
and don't...

lib/talloc/talloc.c

index f58c521f9d937cc4d119e4f315eab75a2ad4e3dd..5497e54ff211b2cf4288962ded14bdd694a1567a 100644 (file)
@@ -2658,6 +2658,9 @@ static int _talloc_is_parent(const void *context, const void *ptr, int depth)
                        tc = tc->parent;
                        depth--;
                }
+               if (depth == 0) {
+                       break;
+               }
        }
        return 0;
 }