Skip to content

Commit 9a4cb87

Browse files
carenasgitster
authored andcommitted
builtin/notes: remove unnecessary free
511726e ("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 <[email protected]> Acked-by: Johan Herland <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cae598d commit 9a4cb87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

builtin/notes.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,8 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
255255

256256
if (get_oid(arg, &object))
257257
die(_("failed to resolve '%s' as a valid ref."), arg);
258-
if (!(buf = read_object_file(&object, &type, &len))) {
259-
free(buf);
258+
if (!(buf = read_object_file(&object, &type, &len)))
260259
die(_("failed to read object '%s'."), arg);
261-
}
262260
if (type != OBJ_BLOB) {
263261
free(buf);
264262
die(_("cannot read note data from non-blob object '%s'."), arg);

0 commit comments

Comments
 (0)