From: Kunhoon Baik Date: Tue, 31 Aug 2021 01:31:40 +0000 (+0900) Subject: Exit test program in case of malloc fail X-Git-Tag: submit/tizen/20210831.013333^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=adcd55edddc105e1eabf00e33417f96fcf66f685;p=platform%2Fupstream%2Fnsjail.git Exit test program in case of malloc fail --- diff --git a/test/memory_syscall_test.cc b/test/memory_syscall_test.cc index 91e2a21..7c14621 100644 --- a/test/memory_syscall_test.cc +++ b/test/memory_syscall_test.cc @@ -10,8 +10,11 @@ int main() int pid; while(1){ a = (char*)calloc(1000*1000,sizeof(char)); - if (a == NULL) + if (a == NULL){ printf("not enough memory\n"); + return -1; + } + for(i=0; i<1000*1000;i++) a[i]=(char)i; usleep(100*1000);