const char *path, char *buffer)
{
char *dir_name;
- char *tmp_path = strdup(path);
+ char *tmp_path = g_strdup(path);
char *base_name = basename(tmp_path);
/* NULL terminate the directory */
snprintf(buffer, PATH_MAX, "%s/%s/%s/%s",
ctx->fs_root, dir_name, VIRTFS_META_DIR, base_name);
- free(tmp_path);
+ g_free(tmp_path);
return buffer;
}
{
int err;
char attr_dir[PATH_MAX];
- char *tmp_path = strdup(path);
+ char *tmp_path = g_strdup(path);
snprintf(attr_dir, PATH_MAX, "%s/%s/%s",
ctx->fs_root, dirname(tmp_path), VIRTFS_META_DIR);
if (err < 0 && errno == EEXIST) {
err = 0;
}
- free(tmp_path);
+ g_free(tmp_path);
return err;
}