From ca5e806e4c27166a27d89cce8a93fba7ed360e55 Mon Sep 17 00:00:00 2001 From: deffpuzzl Date: Thu, 21 Jun 2018 14:30:58 +0800 Subject: [PATCH] fix unload from queue and multithread process --- src/stvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stvm.c b/src/stvm.c index 56c0c2e..d4fdd54 100644 --- a/src/stvm.c +++ b/src/stvm.c @@ -1091,7 +1091,7 @@ long lCreateByFile(char *pszFile) return RC_FAIL; } - if(NULL == (pszCreate = (char *)calloc(stBuf.st_size, 1))) + if(NULL == (pszCreate = (char *)calloc(stBuf.st_size + 1, 1))) { fprintf(stderr, "create memory error, %s\n", strerror(errno)); return RC_FAIL;