Fix segfault when there are no tests registered.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 22 Dec 2008 17:53:19 +0000 (18:53 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 22 Dec 2008 17:53:19 +0000 (18:53 +0100)
source4/torture/smbtorture.c

index 0c2c8c0f6bbcd4e463d96fa1a0d436ed4113ba3e..635990354caa75d297da3c0829dc984b6b252d52 100644 (file)
@@ -49,7 +49,7 @@ static bool run_matching(struct torture_context *torture,
        if (suite == NULL) {
                struct torture_suite *o;
 
-               for (o = torture_root->children; o; o = o->next) {
+               for (o = (torture_root == NULL?NULL:torture_root->children); o; o = o->next) {
                        if (gen_fnmatch(expr, o->name) == 0) {
                                *matched = true;
                                reload_charcnv(torture->lp_ctx);