aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/testcode/asynclook.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-06-24 12:42:28 +0200
committerRiccardo Spagni <ric@spagni.net>2017-06-24 12:42:29 +0200
commit389cd6c466486e670e6f9cd74d2cfdf46f392340 (patch)
treec4b10fac237c407badc8300b2d6116fe6a1ce7cb /external/unbound/testcode/asynclook.c
parentMerge pull request #2073 (diff)
parentUpgrade unbound library (diff)
downloadmonero-389cd6c466486e670e6f9cd74d2cfdf46f392340.tar.xz
Merge pull request #2089
a85b5759 Upgrade unbound library (Erik de Castro Lopo)
Diffstat (limited to 'external/unbound/testcode/asynclook.c')
-rw-r--r--external/unbound/testcode/asynclook.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/external/unbound/testcode/asynclook.c b/external/unbound/testcode/asynclook.c
index 534489735..a2bdb6213 100644
--- a/external/unbound/testcode/asynclook.c
+++ b/external/unbound/testcode/asynclook.c
@@ -64,7 +64,7 @@ struct track_id {
/** true if cancelled */
int cancel;
/** a lock on this structure for thread safety */
- lock_basic_t lock;
+ lock_basic_type lock;
};
/**
@@ -164,7 +164,7 @@ struct ext_thr_info {
/** thread num for debug */
int thread_num;
/** thread id */
- ub_thread_t tid;
+ ub_thread_type tid;
/** context */
struct ub_ctx* ctx;
/** size of array to query */
@@ -335,12 +335,17 @@ ext_thread(void* arg)
r = ub_wait(inf->ctx);
checkerr("ub_ctx_wait", r);
}
+ /* if these locks are destroyed, or if the async_ids is freed, then
+ a use-after-free happens in another thread.
+ The allocation is only part of this test, though. */
+ /*
if(async_ids) {
for(i=0; i<inf->numq; i++) {
lock_basic_destroy(&async_ids[i].lock);
}
}
free(async_ids);
+ */
return NULL;
}
@@ -465,7 +470,7 @@ int main(int argc, char** argv)
return 1;
}
- /* perform asyncronous calls */
+ /* perform asynchronous calls */
num_wait = argc;
for(i=0; i<argc; i++) {
lookups[i].name = argv[i];