Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:46:05
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

The variable 'err' was not necessarily initialized before it was used.

Signed-off-by: Johannes Schindelin <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help