Commit 58a7226d96ec4819adf512e536f3e358c5a63a05

Kano 2012-12-10T18:42:32

minor unlikely zero pointer test

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index b2ffb5c..81a9079 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2853,8 +2853,11 @@ static void recruit_curl(struct pool *pool)
 {
 	struct curl_ent *ce = calloc(sizeof(struct curl_ent), 1);
 
+	if (unlikely(!ce))
+		quit(1, "Failed to calloc in recruit_curl");
+
 	ce->curl = curl_easy_init();
-	if (unlikely(!ce->curl || !ce))
+	if (unlikely(!ce->curl))
 		quit(1, "Failed to init in recruit_curl");
 
 	list_add(&ce->node, &pool->curlring);