char *p = strrchr(dir, '/');
if (!p)
- return (char *)dir;
+ return talloc_strdup(ctx, dir);
return talloc_strdup(ctx, p+1);
}
err(1, "mkdir %s failed", tmpdir);
}
talloc_set_destructor(tmpdir, unlink_all);
+ if (tools_verbose)
+ printf("Created temporary directory %s\n", tmpdir);
}
- if (tools_verbose)
- printf("Created temporary directory %s\n", tmpdir);
return tmpdir;
}