tevent: handle passing req = NULL to tevent_req_print()
authorStefan Metzmacher <metze@samba.org>
Thu, 20 Jul 2017 12:20:03 +0000 (14:20 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 21 Jul 2017 21:31:03 +0000 (23:31 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/tevent/tevent_req.c

index 155746ed6f30165c396487d8213074098793b28a..15754d361ae0f6033602e98b20e2edb71e2c91c0 100644 (file)
@@ -45,6 +45,10 @@ char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
 char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req)
 {
+       if (req == NULL) {
+               return talloc_strdup(mem_ctx, "tevent_req[NULL]");
+       }
+
        if (!req->private_print) {
                return tevent_req_default_print(req, mem_ctx);
        }