Commit 13421eee1ac89a90f45524d8158ace98aae3d0b9

Vicent Marti 2013-04-17T22:32:39

refs: Check alloc is cleaner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/refs.c b/src/refs.c
index 290b89b..982cd05 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -373,8 +373,7 @@ static int reference__create(
 		ref = git_reference__alloc_symbolic(refdb, name, symbolic);
 	}
 	
-	if (ref == NULL)
-		return -1;
+	GITERR_CHECK_ALLOC(ref);
 
 	if ((error = git_refdb_write(refdb, ref)) < 0) {
 		git_reference_free(ref);