commit 96b72a8e59762459b768550828282251000959a4 from: Stefan Sperling via: Thomas Adam date: Mon Jun 13 17:55:22 2022 UTC free id and path in load_packed_tree_ids() on error, else they would leak pointed out by op@ commit - c8fa56b383beaceb4c0baf2bdccc551fe003f035 commit + 96b72a8e59762459b768550828282251000959a4 blob - c4541aaca8aa1f54d98df05ab902e5be210e0145 blob + 4bac848313a6cbddd55ea6a3c66e5db3e9876abe --- lib/pack_create.c +++ lib/pack_create.c @@ -1520,13 +1520,21 @@ load_packed_tree_ids(void *arg, struct got_tree_object if (tree == NULL) { free(a->id); a->id = got_object_id_dup(id); - if (a->id == NULL) - return got_error_from_errno("got_object_id_dup"); + if (a->id == NULL) { + err = got_error_from_errno("got_object_id_dup"); + free(a->dpath); + a->dpath = NULL; + return err; + } free(a->dpath); a->dpath = strdup(dpath); - if (a->dpath == NULL) - return got_error_from_errno("strdup"); + if (a->dpath == NULL) { + err = got_error_from_errno("strdup"); + free(a->id); + a->id = NULL; + return err; + } a->mtime = mtime; return NULL;