diff -r e63951c1d0f8 -r 5ab137def3d1 librazor/root.c --- a/librazor/root.c Thu Nov 10 10:35:21 2011 +0000 +++ b/librazor/root.c Fri Jan 27 08:12:19 2012 +0000 @@ -87,7 +87,7 @@ struct stat buf; struct razor_set *set; struct razor_atomic *atomic; - char *path; + char *file, *path; assert (root != NULL); @@ -109,22 +109,23 @@ return -1; } - path = razor_concat(root, razor_root_path, "/", system_repo_filename, - NULL); + file = razor_concat(razor_root_path, "/", system_repo_filename, NULL); + path = razor_concat(root, file, NULL); retval = !stat(path, &buf); - free(path); if (retval) { fprintf(stderr, "a razor install root is already initialized\n"); + free(path); + free(file); return retval; } atomic = razor_atomic_open("Create initial package set"); - path = razor_concat(razor_root_path, "/", system_repo_filename, NULL); - razor_atomic_make_dirs(atomic, root, path); + razor_atomic_make_dirs(atomic, root, file); set = razor_set_create(); razor_set_write(set, atomic, path, RAZOR_SECTION_ALL); free(path); + free(file); retval = razor_atomic_commit(atomic); if (retval) fprintf(stderr, "could not write initial package set\n");