Commit ea86a1af8a40aaae7461c13889a19144e95f6ff0

Con Kolivas 2014-03-08T10:53:55

Free the work that may be lost, leaking memory, in a failed hfa_send_frame

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/driver-hashfast.c b/driver-hashfast.c
index d985aa2..4fc5aef 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1669,6 +1669,9 @@ restart:
 			sequence = 0;
 		ret = hfa_send_frame(hashfast, OP_HASH, sequence, (uint8_t *)&op_hash_data, sizeof(op_hash_data));
 		if (unlikely(!ret)) {
+			free_work(work);
+			if (base_work)
+				free_work(base_work);
 			hfa_running_shutdown(hashfast, info);
 			return -1;
 		}