[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 2/4] conf: Use only one temporary string in virDomainDiskSourceParse



On Fri, Apr 28, 2017 at 01:10:25PM +0200, Peter Krempa wrote:
---
src/conf/domain_conf.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)


@@ -7565,7 +7566,6 @@ virDomainDiskSourceParse(xmlNodePtr node,
         * as a part of the path. This is hard to work with when dealing with
         * relative names. Split out the volume into a separate variable */
        if (src->path && src->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER) {
-            char *tmp;

This is not a temporary string, just a pointer into a different string
and should not be mixed up with the virXMLPropString usage.

(Maybe this code would look nicer with virStringSplit?)

Jan

            if (!(tmp = strchr(src->path, '/')) ||
                tmp == src->path) {
                virReportError(VIR_ERR_XML_ERROR,

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]