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

[PATCH] Fix a memory leak

From
李李鸿 <leehong@pku.edu.cn>
Date
Dec 16, 2007, 04:53 UTC
Message-ID
<3b74913b3f92.3b3f923b7491@pku.edu.cn>
Signed-off-by: Li Hong <leehong@pku.edu.cn>
---
 dir.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dir.c b/dir.c
index 6b3273d..3e345c2 100644
--- a/dir.c
+++ b/dir.c
@@ -169,7 +169,10 @@ static int add_excludes_from_file_1(const char *fname,
 	}
 	buf = xmalloc(size+1);
 	if (read_in_full(fd, buf, size) != size)
+	{
+		free(buf);
 		goto err;
+	}
 	close(fd);
 
 	if (buf_p)
-- 
1.5.4.rc0.8.gaba5e
Message 1 of 1 in “Fix a memory leak”
  1. Fix a memory leak李鸿, Dec 16, 2007

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.