utf8: release strbuf on error return in strbuf_utf8_replace()
[gitweb.git] / transport-helper.c
index 33cff38cc0b9b4a2d05b26544c9edda9caa33e9a..519a2445835e647f036fc2cda8e66fccb6fecac1 100644 (file)
@@ -604,6 +604,7 @@ static int process_connect_service(struct transport *transport,
                        cmdbuf.buf);
 
 exit:
+       strbuf_release(&cmdbuf);
        fclose(input);
        return ret;
 }
@@ -927,7 +928,7 @@ static int push_refs_with_export(struct transport *transport,
                struct object_id oid;
 
                private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
-               if (private && !get_sha1(private, oid.hash)) {
+               if (private && !get_oid(private, &oid)) {
                        strbuf_addf(&buf, "^%s", private);
                        string_list_append(&revlist_args, strbuf_detach(&buf, NULL));
                        oidcpy(&ref->old_oid, &oid);