discover: Allocate contexts with talloc_zero
authorJeremy Kerr <jk@ozlabs.org>
Wed, 6 Nov 2013 08:33:23 +0000 (16:33 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 6 Nov 2013 08:34:26 +0000 (16:34 +0800)
Ensure all pointers from the context are NULL.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/device-handler.c

index 43bcd9f760249444d86eae8587bfb8725d8987b6..a497147918d43232498d23eeb833b4101d1ec6c0 100644 (file)
@@ -524,10 +524,8 @@ struct discover_context *device_handler_discover_context_create(
 {
        struct discover_context *ctx;
 
-       ctx = talloc(handler, struct discover_context);
+       ctx = talloc_zero(handler, struct discover_context);
        ctx->device = device;
-       ctx->conf_url = NULL;
-       ctx->test_data = NULL;
        list_init(&ctx->boot_options);
 
        return ctx;