From: Maarten Bosmans Date: Mon, 05 Feb 2024 20:49:31 GMT Subject: [PATCH 3/4] notes: do not clean up right before calling die() Message-ID: <20240205204932.16653-4-maarten.bosmans@vortech.nl> In-Reply-To: <20240205204932.16653-1-maarten.bosmans@vortech.nl> From: Maarten Bosmans From: Maarten Bosmans For consistency with the other uses of die() in the same function. Signed-off-by: Maarten Bosmans --- builtin/notes.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 048b8c559c..0e98a820dd 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -310,12 +310,8 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset) die(_("failed to resolve '%s' as a valid ref."), arg); if (!(value = repo_read_object_file(the_repository, &object, &type, &len))) die(_("failed to read object '%s'."), arg); - if (type != OBJ_BLOB) { - strbuf_release(&msg->buf); - free(value); - free(msg); + if (type != OBJ_BLOB) die(_("cannot read note data from non-blob object '%s'."), arg); - } strbuf_add(&msg->buf, value, len); free(value); -- 2.35.3