Commit 3a6420f378bce074d55721ed0c13c97fa9f088c7

Rick Bradley 2012-12-18T17:46:18

don't deref before we've asserted just sayin'.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/reflog.c b/src/reflog.c
index df799b1..2756229 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -208,10 +208,10 @@ int git_reflog_read(git_reflog **reflog, const git_reference *ref)
 	git_buf log_file = GIT_BUF_INIT;
 	git_reflog *log = NULL;
 
-	*reflog = NULL;
-
 	assert(reflog && ref);
 
+	*reflog = NULL;
+
 	if (reflog_init(&log, ref) < 0)
 		return -1;