Merge branch 'jk/snprintf-cleanups'
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Apr 2017 05:07:56 +0000 (22:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Apr 2017 05:07:56 +0000 (22:07 -0700)
Hotfix for a topic that is already in 'master'.

* jk/snprintf-cleanups:
  replace: plug a memory leak

builtin/replace.c

index 065515b..ab17668 100644 (file)
@@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
                if (fn(full_hex, ref.buf, &oid))
                        had_error = 1;
        }
+       strbuf_release(&ref);
        return had_error;
 }