)]}'
{
  "commit": "ef4fe5617eadc24fd09ce7778b77bb87f147480c",
  "tree": "83aec44a41bc665699ca91c5f4ee96ec0cdbb5c9",
  "parents": [
    "95d67879735cfecfdd85f89e59d993c5b4de8835"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Thu May 25 15:33:05 2017 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri May 26 12:51:06 2017 +0900"
  },
  "message": "connect.c: fix leak in parse_one_symref_info()\n\nIf we successfully parse a symref value like\n\"HEAD:refs/heads/master\", we add the result to a string\nlist. But because the string list is marked\nSTRING_LIST_INIT_DUP, the string list code will make a copy\nof the string and add the copy.\n\nThis patch fixes it by adding the entry with\nstring_list_append_nodup(), which lets the string list take\nownership of our newly allocated string. There are two\nalternatives that seem like they would work, but aren\u0027t the\nright solution.\n\nThe first is to initialize the list with the \"NODUP\"\ninitializer. That would avoid the copy, but then the string\nlist would not realize that it owns the strings. When we\neventually call string_list_clear(), it would not free the\nstrings, causing a leak.\n\nThe second option would be to use the normal\nstring_list_append(), but free the local copy in our\nfunction. We can\u0027t do this because the local copy actually\ncontains _two_ strings; the symref name and its target. We\npoint to the target pointer via the \"util\" field, and its\nmemory must last as long as the string list does.\n\nYou may also wonder whether it\u0027s safe to ever free the local\ncopy, since the target points into it. The answer is yes,\nbecause we duplicate it in annotaate_refs_with_symref_info\nbefore clearing the string list.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8cb93b0720d9a33d8fc0cddb21c3d1c1a789da96",
      "old_mode": 33188,
      "old_path": "connect.c",
      "new_id": "8af002bf0fadcee5619f3773d7014af178e6d5e5",
      "new_mode": 33188,
      "new_path": "connect.c"
    }
  ]
}
