From: Arjun Sreedharan Date: Wed, 1 Apr 2015 19:06:48 +0000 (+0530) Subject: concurrent: check realloc() rc and exit on failure X-Git-Tag: lxc-2.0.0.beta1~332 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea7e3744e70e9f29ef6962b70121d785b310317a;p=thirdparty%2Flxc.git concurrent: check realloc() rc and exit on failure Signed-off-by: Arjun Sreedharan Acked-by: Serge E. Hallyn --- diff --git a/src/tests/concurrent.c b/src/tests/concurrent.c index acabbed4f..f32411afe 100644 --- a/src/tests/concurrent.c +++ b/src/tests/concurrent.c @@ -182,6 +182,10 @@ int main(int argc, char *argv[]) { (tok = strtok_r(mode_tok, ",", &saveptr)); i++, mode_tok = NULL) { modes = realloc(modes, sizeof(*modes) * (i+2)); + if (!modes) { + perror("realloc"); + exit(EXIT_FAILURE); + } modes[i] = tok; } modes[i] = NULL;