git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix leak in diffcore-order.c

From
Junio C Hamano <junkio@cox.net>
Date
May 28, 2005, 16:44 UTC
Message-ID
<7vekbruwom.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vzmufwu8w.fsf@assigned-by-dhcp.cox.net>

A temporary array used for sorting the filepairs were not freed after use.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

diffcore-order.c | 1 + 1 files changed, 1 insertion(+)

diff --git a/diffcore-order.c b/diffcore-order.c
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -117,5 +117,6 @@ void diffcore_order(const char *orderfil
 	qsort(o, q->nr, sizeof(*o), compare_pair_order);
 	for (i = 0; i < q->nr; i++)
 		q->queue[i] = o[i].pair;
+	free(o);
 	return;
 }
------------------------------------------------
Previous: Junio C HamanoNext: Linus Torvalds
Message 10 of 13 in “Add -O<orderfile> option to diff-* brothers.”
  1. Add -O<orderfile> option to diff-* brothers.Junio C Hamano, May 28, 2005
  2. Thomas GlanzmannMay 28, 2005
  3. Junio C HamanoMay 28, 2005
  4. Thomas GlanzmannMay 28, 2005
  5. Junio C HamanoMay 30, 2005
  6. Petr BaudisMay 28, 2005
  7. Thomas GlanzmannMay 28, 2005
  8. Junio C HamanoMay 28, 2005
  9. Junio C HamanoMay 28, 2005
  10. Fix leak in diffcore-order.cJunio C Hamano, May 28, 2005
  11. Linus TorvaldsMay 29, 2005
  12. Junio C HamanoMay 29, 2005
  13. Junio C HamanoMay 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.