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

[PATCH] delete_ref(): fix uninitialized value, found by valgrind

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 3, 2009, 18:12 UTC
Message-ID
<alpine.DEB.1.00.0902031912290.9822@pacific.mpi-cbg.de>
In-Reply-To
<cover.1233684745u.git.johannes.schindelin@gmx.de>
The variable 'err' was not necessarily initialized before it was used.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 refs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/refs.c b/refs.c
index b13e01b..ded7ec4 100644
--- a/refs.c
+++ b/refs.c
@@ -929,7 +929,7 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
 int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
 {
 	struct ref_lock *lock;
-	int err, i = 0, ret = 0, flag = 0;
+	int err = 0, i = 0, ret = 0, flag = 0;
 	struct stat loginfo;
 	int log = !lstat(git_path("logs/%s", refname), &loginfo);
 
-- 
1.6.1.2.574.g140d5
Next: Junio C Hamano
Message 1 of 3 in “delete_ref(): fix uninitialized value, found by valgrind”
  1. delete_ref(): fix uninitialized value, found by valgrindJohannes Schindelin, Feb 3, 2009
  2. Junio C HamanoFeb 4, 2009
  3. Johannes SchindelinFeb 4, 2009

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.