@@ -191,6 +191,7 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
backlog = malloc(sizeof(uint32_t)*backlog_max);
if (backlog == NULL) {
applog(LOG_ERR, "%s: failed to allocate backlog[%d]", ztex->repr, backlog_max);
+ free(lastnonce);
return 0;
}
memset(backlog, 0, sizeof(uint32_t)*backlog_max);