]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/tal.c
take, tal, tal/path, tal/str, tal/talloc: annotate APIs with TAKES.
[ccan] / ccan / tal / tal.c
index 2a2eca77c04f5bbd37cc35e4ee4c4507e17ec33a..331f7ea5ca5bca91fd7249bbdc0ca8f83300b73d 100644 (file)
@@ -2,7 +2,6 @@
 #include <ccan/tal/tal.h>
 #include <ccan/compiler/compiler.h>
 #include <ccan/list/list.h>
-#include <ccan/take/take.h>
 #include <ccan/alignof/alignof.h>
 #include <assert.h>
 #include <stdio.h>
@@ -654,6 +653,9 @@ size_t tal_len(const tal_t *ptr)
 {
        struct length *l;
 
+       if (!ptr)
+               return 0;
+
        l = find_property(debug_tal(to_tal_hdr(ptr)), LENGTH);
        if (!l)
                return 0;