diff --git a/ccminer.cpp b/ccminer.cpp index 960eb6620..f3eba6a7e 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1180,7 +1180,7 @@ static bool get_work(struct thr_info *thr, struct work *work) } /* fill out work request message */ - wc = (struct workio_cmd *)calloc(1, sizeof(*wc)); + wc = (struct workio_cmd *)calloc(1, sizeof(struct workio_cmd)); if(wc == NULL) { applog(LOG_ERR, "Out of memory!"); @@ -1213,7 +1213,7 @@ static bool submit_work(struct thr_info *thr, const struct work *work_in) { struct workio_cmd *wc; /* fill out work request message */ - wc = (struct workio_cmd *)calloc(1, sizeof(*wc)); + wc = (struct workio_cmd *)calloc(1, sizeof(struct workio_cmd)); if(wc == NULL) { applog(LOG_ERR, "Out of memory!"); diff --git a/util.cpp b/util.cpp index d06a840a0..67fcdf145 100644 --- a/util.cpp +++ b/util.cpp @@ -185,7 +185,7 @@ void applog(int prio, const char *fmt, ...) free(f); if (opt_logfile) { - fl = (char*)alloca(len); + fl = (char*)malloc(len); sprintf(fl, "[%d-%02d-%02d %02d:%02d:%02d] %s\n", tm.tm_year + 1900, tm.tm_mon + 1,