am: fix commit buffer leak in get_commit_info()
[gitweb.git] / builtin / am.c
index 826f18ba12d9c58ceb3e8d6998412c234b33bcfe..8dfe8f84fa461dd37850fecebcfe5a6943f789b3 100644 (file)
@@ -1417,6 +1417,7 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
                die(_("unable to parse commit %s"), oid_to_hex(&commit->object.oid));
        state->msg = xstrdup(msg + 2);
        state->msg_len = strlen(state->msg);
+       unuse_commit_buffer(commit, buffer);
 }
 
 /**