Adapt to VIR_STRDUP and VIR_STRNDUP in tests/*

This commit is contained in:
Michal Privoznik
2013-05-03 14:52:21 +02:00
parent aaf8114d56
commit e60b9783e1
16 changed files with 71 additions and 67 deletions

View File

@@ -21,6 +21,8 @@
# include "testutilsqemu.h"
# include "virstring.h"
# define VIR_FROM_THIS VIR_FROM_QEMU
static const char *abs_top_srcdir;
static virQEMUDriver driver;
@@ -68,7 +70,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
* detects such paths, strips the extra '/' and makes the path absolute.
*/
if (vmdef->emulator && STRPREFIX(vmdef->emulator, "/.")) {
if (!(emulator = strdup(vmdef->emulator + 1)))
if (VIR_STRDUP(emulator, vmdef->emulator + 1) < 0)
goto fail;
VIR_FREE(vmdef->emulator);
vmdef->emulator = NULL;