Commit b8757dcd2792eca394d721c1439bcfc7fbb20cab

Con Kolivas 2014-03-28T09:41:45

Fix two potential minor mem leaks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index ccf44ae..b011c89 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6593,6 +6593,7 @@ retry_stratum:
 				ret = setup_gbt_solo(curl, pool);
 				if (ret)
 					pool_start_lp(pool);
+				free_work(work);
 				goto out;
 			}
 			applog(LOG_DEBUG, "Successfully retrieved and deciphered work from pool %u %s",
@@ -7987,6 +7988,8 @@ retry_pool:
 
 				cgsleep_ms(500);
 			} else {
+				if (val)
+					json_decref(val);
 				cgtime(&end);
 				if (end.tv_sec - start.tv_sec > 30)
 					continue;