X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftalloc%2Ftest%2Frun.c;h=c501a7f9f4862d96afc4f21e3986f7885b6f060d;hp=06f9249a152ae71f04cd0d769f7e8a137330437a;hb=bf57898eae29d70a166bf2df5c84601729f039ac;hpb=d40331c745a6e4a56a3ea210ef9e1e264f7e6e5a diff --git a/ccan/talloc/test/run.c b/ccan/talloc/test/run.c index 06f9249a..c501a7f9 100644 --- a/ccan/talloc/test/run.c +++ b/ccan/talloc/test/run.c @@ -937,7 +937,7 @@ static void *normal_realloc(const void *parent, void *ptr, size_t size) } allocations[i] = realloc(ptr, size); - /* Not guarenteed by realloc. */ + /* Not guaranteed by realloc. */ if (!size) allocations[i] = NULL; @@ -948,7 +948,7 @@ int main(void) { struct torture_context *ctx; - plan_tests(288); + plan_tests(289); ctx = talloc_add_external(NULL, normal_realloc, test_lock, test_unlock); torture_local_talloc(NULL); @@ -979,6 +979,10 @@ int main(void) ok(allocations_used() == 0, "%u allocations still used?", allocations_used()); + /* This closes the leak, but make sure we're not freeing unexpected. */ + ok1(!talloc_chunk_from_ptr(null_context)->child); + talloc_disable_null_tracking(); + return exit_status(); }