Commit 9d8fa5379942e6dded14a9df053a69ebba136056

Russell Belfer 2012-12-18T15:48:17

Merge pull request #1158 from rick/i-do-not-think-this-means-what-you-think-it-means don't deref before we've asserted

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;