summaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorLibravatar Carlo Marcelo Arenas Belón <carenas@gmail.com>2018-11-11 01:49:33 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-11-13 12:03:15 +0900
commit9a4cb8781e4eec0445e7f3b693aa3589436255b9 (patch)
treeb0aaa5e6ac134c9e930c110913748694dc6d76c5 /builtin/notes.c
parentGit 2.19.1 (diff)
downloadtgif-9a4cb8781e4eec0445e7f3b693aa3589436255b9.tar.xz
builtin/notes: remove unnecessary free
511726e4b1 ("builtin/notes: fix premature failure when trying to add the empty blob", 2014-11-09) removed the check for !len but left a call to free the buffer that will be otherwise NULL Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index c05cd004ab..68062f7475 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -255,10 +255,8 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
if (get_oid(arg, &object))
die(_("failed to resolve '%s' as a valid ref."), arg);
- if (!(buf = read_object_file(&object, &type, &len))) {
- free(buf);
+ if (!(buf = read_object_file(&object, &type, &len)))
die(_("failed to read object '%s'."), arg);
- }
if (type != OBJ_BLOB) {
free(buf);
die(_("cannot read note data from non-blob object '%s'."), arg);