]> git.ozlabs.org Git - ccan/blobdiff - tools/tools.c
ccanlint: fix abort on "-d ..".
[ccan] / tools / tools.c
index b7beda72b9c5b6cf0a5ec8beffb34d535887b6a3..2983cfca663bc730130899ae96cb16a75e62baa2 100644 (file)
@@ -28,7 +28,7 @@ char *talloc_basename(const void *ctx, const char *dir)
        char *p = strrchr(dir, '/');
 
        if (!p)
-               return (char *)dir;
+               return talloc_strdup(ctx, dir);
        return talloc_strdup(ctx, p+1);
 }