refs: fix valgrind suppression file
[gitweb.git] / sequencer.c
index bde5f047b01376e05255a55516d3bdd261f497ea..0a80c58d1194c3476dfd2861a98fbd08610597a3 100644 (file)
@@ -281,8 +281,12 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,
                exit(1); /* the callee should have complained already */
        ref_lock = lock_any_ref_for_update("HEAD", unborn ? null_sha1 : from,
                                           0, NULL);
+       if (!ref_lock)
+               return error(_("Failed to lock HEAD during fast_forward_to"));
+
        strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
        ret = write_ref_sha1(ref_lock, to, sb.buf);
+
        strbuf_release(&sb);
        return ret;
 }