Cc: arm...@redhat.com
Cc: laur...@vivier.eu
Cc: tony.ngu...@bt.com

Signed-off-by: Mao Zhongyi <maozhon...@cmss.chinamobile.com>
---
 tests/migration/stress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/migration/stress.c b/tests/migration/stress.c
index d9aa4afe92..e6c9a6b243 100644
--- a/tests/migration/stress.c
+++ b/tests/migration/stress.c
@@ -181,6 +181,8 @@ static int stressone(unsigned long long ramsizeMB)
     if (!ram) {
         fprintf(stderr, "%s (%05d): ERROR: cannot allocate %llu MB of RAM: 
%s\n",
                 argv0, gettid(), ramsizeMB, strerror(errno));
+        if (data)
+            free(data);
         return -1;
     }
     if (!data) {
-- 
2.17.1




Reply via email to