Fix missing OOM check in qemuParseCommandLine when splitting strings

The qemuParseCommandLine method did not check the return value of
virStringSplit to see if OOM had occurred. This lead to dereference
of a NULL pointer on OOM.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-09-23 14:18:04 +01:00
parent 5923ea67b1
commit 5dd3b5e32a

View File

@ -11387,7 +11387,8 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
* Set os.machine only if first parameter lacks '=' or
* contains explicit type='...' */
WANT_VALUE();
list = virStringSplit(val, ",", 0);
if (!(list = virStringSplit(val, ",", 0)))
goto error;
param = list[0];
if (STRPREFIX(param, "type="))