r12068: a better fix to prevent crashing, on errors
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Dec 2005 10:15:56 +0000 (10:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:04 +0000 (13:47 -0500)
metze
(This used to be commit 7b20f8e66d55774877ec1441175fb707856c6609)

source4/torture/nbt/winsreplication.c

index 6bf25146fe42f32d03b7c95044a0c8e999747451..4ca9ed77cd0698c276b617f66ef249acb8ee1abf 100644 (file)
@@ -1096,8 +1096,6 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
                }
        };
 
-       if (!ctx) return False;
-
        name.name       = "_SAME_OWNER_A";
        name.type       = 0;
        name.scope      = NULL;
@@ -4634,8 +4632,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
                }
        }}; /* do not add entries here, this should be the last record! */
 
-       if (!ctx) return False;
-
        wins_name_r1    = &wins_name1;
        wins_name_r2    = &wins_name2;
 
@@ -6385,8 +6381,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c
        },
        };
 
-       if (!ctx) return False;
-
        printf("Test Replica records vs. owned released records\n");
 
        for(i=0; ret && i < ARRAY_SIZE(records); i++) {
@@ -9018,8 +9012,6 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con
        },
        };
 
-       if (!ctx) return False;
-
        if (!ctx->nbtsock_srv) {
                printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
                        lp_nbt_port());
@@ -9511,6 +9503,7 @@ BOOL torture_nbt_winsreplication_quick(void)
        ret &= test_wins_replication(mem_ctx, address);
 
        ctx = test_create_conflict_ctx(mem_ctx, address);
+       if (!ctx) return False;
 
        ret &= test_conflict_same_owner(ctx);
        ret &= test_conflict_owned_released_vs_replica(ctx);
@@ -9549,6 +9542,7 @@ BOOL torture_nbt_winsreplication(void)
        ret &= test_wins_replication(mem_ctx, address);
 
        ctx = test_create_conflict_ctx(mem_ctx, address);
+       if (!ctx) return False;
 
        ret &= test_conflict_same_owner(ctx);
        ret &= test_conflict_different_owner(ctx);