s3:torture: fix segfault in LOCAL-TALLOC-DICT
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Mar 2012 07:22:03 +0000 (08:22 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Mar 2012 07:26:35 +0000 (08:26 +0100)
talloc_dict_set() expects a pointer to an talloc'ed pointer.

metze

source3/torture/torture.c

index 159dc0bd0c914318038ddc43bf14dafecdf36ede..e2a2744daecaa3406bacc087603c5bfc22ba48e7 100644 (file)
@@ -7971,6 +7971,7 @@ static bool run_local_talloc_dict(int dummy)
        struct talloc_dict *dict;
        struct talloc_dict_test *t;
        int key, count, res;
+       bool ok;
 
        dict = talloc_dict_init(talloc_tos());
        if (dict == NULL) {
@@ -7984,7 +7985,8 @@ static bool run_local_talloc_dict(int dummy)
 
        key = 1;
        t->content = 1;
-       if (!talloc_dict_set(dict, data_blob_const(&key, sizeof(key)), t)) {
+       ok = talloc_dict_set(dict, data_blob_const(&key, sizeof(key)), &t);
+       if (!ok) {
                return false;
        }