checkout: fix memory leak
[gitweb.git] / builtin / checkout.c
index 5faea3a05fa620e490a71793a474e0284a9043bb..94849cf250ebcf35efe17c120205359d91ae7648 100644 (file)
@@ -247,6 +247,7 @@ static int checkout_merged(int pos, const struct checkout *state)
        if (write_sha1_file(result_buf.ptr, result_buf.size,
                            blob_type, oid.hash))
                die(_("Unable to add merge result for '%s'"), path);
+       free(result_buf.ptr);
        ce = make_cache_entry(mode, oid.hash, path, 2, 0);
        if (!ce)
                die(_("make_cache_entry failed for path '%s'"), path);