goto cleanup;
}
- virAsprintf(&src, "[%s] %s", datastoreName, directoryAndFileName);
+ if (virAsprintf(&src, "[%s] %s", datastoreName,
+ directoryAndFileName) < 0)
+ goto cleanup;
} else if (STRPREFIX(fileName, "/")) {
/* Found absolute path referencing a file outside a datastore */
src = strdup(fileName);
src = NULL;
} else {
/* Found single file name referencing a file inside a datastore */
- virAsprintf(&src, "[datastore] directory/%s", fileName);
+ if (virAsprintf(&src, "[datastore] directory/%s", fileName) < 0)
+ goto cleanup;
}
cleanup:
directoryAndFileName += strspn(directoryAndFileName, " ");
}
- virAsprintf(&absolutePath, "/vmfs/volumes/%s/%s", datastoreName,
- directoryAndFileName);
+ if (virAsprintf(&absolutePath, "/vmfs/volumes/%s/%s", datastoreName,
+ directoryAndFileName) < 0)
+ goto cleanup;
} else if (STRPREFIX(src, "/")) {
/* Found absolute path */
absolutePath = strdup(src);