<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.c, branch v2.15.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.15.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2017-11-08T02:34:00Z</updated>
<entry>
<title>reduce_heads: fix memory leaks</title>
<updated>2017-11-08T02:34:00Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-11-07T20:39:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4da72644b768b0491110a8ba0aa84d32b6bde41c'/>
<id>urn:sha1:4da72644b768b0491110a8ba0aa84d32b6bde41c</id>
<content type='text'>
We currently have seven callers of `reduce_heads(foo)`. Six of them do
not use the original list `foo` again, and actually, all six of those
end up leaking it.

Introduce and use `reduce_heads_replace(&amp;foo)` as a leak-free version of
`foo = reduce_heads(foo)` to fix several of these. Fix the remaining
leaks using `free_commit_list()`.

While we're here, document `reduce_heads()` and mark it as `extern`.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ma/leakplugs'</title>
<updated>2017-09-29T02:23:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-29T02:23:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=69c54c72845ebc686d0f4bdd8d44b06f799b0a80'/>
<id>urn:sha1:69c54c72845ebc686d0f4bdd8d44b06f799b0a80</id>
<content type='text'>
Memory leaks in various codepaths have been plugged.

* ma/leakplugs:
  pack-bitmap[-write]: use `object_array_clear()`, don't leak
  object_array: add and use `object_array_pop()`
  object_array: use `object_array_clear()`, not `free()`
  leak_pending: use `object_array_clear()`, not `free()`
  commit: fix memory leak in `reduce_heads()`
  builtin/commit: fix memory leak in `prepare_index()`
</content>
</entry>
<entry>
<title>commit: fix memory leak in `reduce_heads()`</title>
<updated>2017-09-24T01:05:51Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-09-22T23:34:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cb7b29eb67772d08e2365ed07ede9d954d0344c1'/>
<id>urn:sha1:cb7b29eb67772d08e2365ed07ede9d954d0344c1</id>
<content type='text'>
We don't free the temporary scratch space we use with
`remove_redundant()`. Free it similar to how we do it in
`get_merge_bases_many_0()`.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/strbuf-leakfix'</title>
<updated>2017-09-19T01:47:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-19T01:47:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d811ba1897b723fd0146875201061e3603c16391'/>
<id>urn:sha1:d811ba1897b723fd0146875201061e3603c16391</id>
<content type='text'>
Many leaks of strbuf have been fixed.

* rs/strbuf-leakfix: (34 commits)
  wt-status: release strbuf after use in wt_longstatus_print_tracking()
  wt-status: release strbuf after use in read_rebase_todolist()
  vcs-svn: release strbuf after use in end_revision()
  utf8: release strbuf on error return in strbuf_utf8_replace()
  userdiff: release strbuf after use in userdiff_get_textconv()
  transport-helper: release strbuf after use in process_connect_service()
  sequencer: release strbuf after use in save_head()
  shortlog: release strbuf after use in insert_one_record()
  sha1_file: release strbuf on error return in index_path()
  send-pack: release strbuf on error return in send_pack()
  remote: release strbuf after use in set_url()
  remote: release strbuf after use in migrate_file()
  remote: release strbuf after use in read_remote_branches()
  refs: release strbuf on error return in write_pseudoref()
  notes: release strbuf after use in notes_copy_from_stdin()
  merge: release strbuf after use in write_merge_heads()
  merge: release strbuf after use in save_state()
  mailinfo: release strbuf on error return in handle_boundary()
  mailinfo: release strbuf after use in handle_from()
  help: release strbuf on error return in exec_woman_emacs()
  ...
</content>
</entry>
<entry>
<title>commit: release strbuf on error return in commit_tree_extended()</title>
<updated>2017-09-06T23:49:27Z</updated>
<author>
<name>Rene Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-30T17:49:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e505146dac276cc051eca199f9dc7ca88bef5f18'/>
<id>urn:sha1:e505146dac276cc051eca199f9dc7ca88bef5f18</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: rewrite read_graft_line</title>
<updated>2017-08-18T19:41:06Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2017-08-18T18:33:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cfa5bf16082e25c9221e26851ca890f71ddf5a5f'/>
<id>urn:sha1:cfa5bf16082e25c9221e26851ca890f71ddf5a5f</id>
<content type='text'>
Old implementation determined number of hashes by dividing length of
line by length of hash, which works only if all hash representations
have same length.

New graft line parser works in two phases:

  1. In first phase line is scanned to verify correctness and compute
     number of hashes, then graft struct is allocated.

  2. In second phase line is scanned again to fill up already allocated
     graft struct.

This way graft parsing code can support different sizes of hashes
without any further code adaptations.

A number of alternative implementations were considered and discarded:

  - Modifying graft structure to store oid_array instead of FLEXI_ARRAY
    indicates undesirable usage of struct to readers.

  - Parsing into temporary string_list or oid_array complicates code
    by adding more return paths, as these structures needs to be
    cleared before returning from function.

  - Determining number of hashes by counting separators might cause
    maintenance issues, if this function needs to be modified in future
    again.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: allocate array using object_id size</title>
<updated>2017-08-18T19:18:10Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2017-08-18T18:33:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bc65d2262d7c676cc7a0100d8be84a0690e10702'/>
<id>urn:sha1:bc65d2262d7c676cc7a0100d8be84a0690e10702</id>
<content type='text'>
struct commit_graft aggregates an array of object_id's, which have
size &gt;= GIT_MAX_RAWSZ bytes. This change prevents memory allocation
error when size of object_id is larger than GIT_SHA1_RAWSZ.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: replace the raw buffer with strbuf in read_graft_line</title>
<updated>2017-08-18T19:18:10Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2017-08-18T18:33:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9a9340329a7151697c943794369950115963879f'/>
<id>urn:sha1:9a9340329a7151697c943794369950115963879f</id>
<content type='text'>
This simplifies function declaration and allows for use of strbuf_rtrim
instead of modifying buffer directly.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/move-array'</title>
<updated>2017-08-11T20:26:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-11T20:26:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=32f90258bd510d84dfe8970211ec1427e9e327dc'/>
<id>urn:sha1:32f90258bd510d84dfe8970211ec1427e9e327dc</id>
<content type='text'>
Code clean-up.

* rs/move-array:
  ls-files: don't try to prune an empty index
  apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
  use MOVE_ARRAY
  add MOVE_ARRAY
</content>
</entry>
<entry>
<title>use MOVE_ARRAY</title>
<updated>2017-07-17T21:54:56Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-07-15T20:00:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f331ab9d4cb21942dcde6d879aaca6a1784e8cb6'/>
<id>urn:sha1:f331ab9d4cb21942dcde6d879aaca6a1784e8cb6</id>
<content type='text'>
Simplify the code for moving members inside of an array and make it more
robust by using the helper macro MOVE_ARRAY.  It calculates the size
based on the specified number of elements for us and supports NULL
pointers when that number is zero.  Raw memmove(3) calls with NULL can
cause the compiler to (over-eagerly) optimize out later NULL checks.

This patch was generated with contrib/coccinelle/array.cocci and spatch
(Coccinelle).

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
