]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
daemon: Remove unnecessary goto error
authorWang King <king.wang@huawei.com>
Mon, 24 Apr 2017 04:05:25 +0000 (12:05 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 25 Apr 2017 09:30:41 +0000 (11:30 +0200)
Freeing the dst is unnecessary if the VIR_STRDUP fails, and therefore
we need to remove the error label as well.

daemon/remote.c

index a8c21fd2fff1a0a97aace240d052e174dfd0afde..2709c3ccdfd41ed7f0ce916b8be0f2f3c34cece8 100644 (file)
@@ -648,7 +648,7 @@ remoteRelayDomainEventBlockJob(virConnectPtr conn,
     /* build return data */
     memset(&data, 0, sizeof(data));
     if (VIR_STRDUP(data.path, path) < 0)
-        goto error;
+        return -1;
     data.type = type;
     data.status = status;
     make_nonnull_domain(&data.dom, dom);
@@ -667,9 +667,6 @@ remoteRelayDomainEventBlockJob(virConnectPtr conn,
     }
 
     return 0;
- error:
-    VIR_FREE(data.path);
-    return -1;
 }
 
 
@@ -1025,7 +1022,7 @@ remoteRelayDomainEventBlockJob2(virConnectPtr conn,
     memset(&data, 0, sizeof(data));
     data.callbackID = callback->callbackID;
     if (VIR_STRDUP(data.dst, dst) < 0)
-        goto error;
+        return -1;
     data.type = type;
     data.status = status;
     make_nonnull_domain(&data.dom, dom);
@@ -1035,9 +1032,6 @@ remoteRelayDomainEventBlockJob2(virConnectPtr conn,
                                   (xdrproc_t)xdr_remote_domain_event_block_job_2_msg, &data);
 
     return 0;
- error:
-    VIR_FREE(data.dst);
-    return -1;
 }