commit - a436ad14b580220cf835e8386b241b42903a0339
commit + 8d2c5ea3cf75adc256f3fc1b9cd19667fe6f8d07
blob - 90e8331aa0d5ab5db7909bb85d3c2623d80126eb
blob + 63fbc857f6aca730ac30a8872e56c453ca7b60a3
--- lib/object.c
+++ lib/object.c
const struct got_error *err = NULL;
struct got_packidx *packidx = NULL;
int idx;
- char *path_packfile;
+ char *path_packfile = NULL;
if (check_cache) {
*commit = got_repo_get_cached_commit(repo, id);
err = got_repo_cache_pack(&pack, repo, path_packfile,
packidx);
if (err)
- return err;
+ goto done;
}
err = read_packed_commit_privsep(commit, pack,
packidx, idx, id);
(*commit)->refcnt++;
err = got_repo_cache_commit(repo, id, *commit);
}
-
+done:
+ free(path_packfile);
return err;
}
const struct got_error *err = NULL;
struct got_packidx *packidx = NULL;
int idx;
- char *path_packfile;
+ char *path_packfile = NULL;
if (check_cache) {
*tree = got_repo_get_cached_tree(repo, id);
err = got_repo_cache_pack(&pack, repo, path_packfile,
packidx);
if (err)
- return err;
+ goto done;
}
err = read_packed_tree_privsep(tree, pack,
packidx, idx, id);
(*tree)->refcnt++;
err = got_repo_cache_tree(repo, id, *tree);
}
-
+done:
+ free(path_packfile);
return err;
}
const struct got_error *err = NULL;
struct got_packidx *packidx = NULL;
int idx;
- char *path_packfile;
+ char *path_packfile = NULL;
uint8_t *outbuf;
int outfd;
size_t size, hdrlen;
memcpy(&(*blob)->id.sha1, id->sha1, SHA1_DIGEST_LENGTH);
done:
+ free(path_packfile);
if (err) {
if (*blob) {
got_object_blob_close(*blob);
const struct got_error *err = NULL;
struct got_packidx *packidx = NULL;
int idx;
- char *path_packfile;
+ char *path_packfile = NULL;
if (check_cache) {
*tag = got_repo_get_cached_tag(repo, id);
err = got_repo_cache_pack(&pack, repo, path_packfile,
packidx);
if (err)
- return err;
+ goto done;
}
err = read_packed_tag_privsep(tag, pack,
packidx, idx, id);
(*tag)->refcnt++;
err = got_repo_cache_tag(repo, id, *tag);
}
-
+done:
+ free(path_packfile);
return err;
}