From: Michael Santos Date: Wed, 16 Mar 2011 14:04:13 +0000 (-0400) Subject: Exit if allocation fails X-Git-Tag: lxc-0.7.5~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=302aaa2b2dc9c0fe22a7214ffbc974a01995ec06;p=thirdparty%2Flxc.git Exit if allocation fails Signed-off-by: Michael Santos Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 314d4a5ee..1da090617 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -69,6 +69,10 @@ int main(int argc, char *argv[]) return -1; regexp = malloc(strlen(my_args.name) + 3); + if (!regexp) { + ERROR("failed to allocate memory"); + return -1; + } sprintf(regexp, "^%s$", my_args.name); if (regcomp(&preg, regexp, REG_NOSUB|REG_EXTENDED)) {