[libvirt] [PATCH v1 08/21] openvz_conf.c: remove unneeded cleanup label

Daniel Henrique Barboza posted 21 patches 6 years, 3 months ago
There is a newer version of this series
[libvirt] [PATCH v1 08/21] openvz_conf.c: remove unneeded cleanup label
Posted by Daniel Henrique Barboza 6 years, 3 months ago
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 src/openvz/openvz_conf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 4646308c48..f12c91aa88 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -873,12 +873,11 @@ openvzLocateConfDir(void)
     while (conf_dir_list[i]) {
         if (virFileExists(conf_dir_list[i])) {
             ret = g_strdup(conf_dir_list[i]);
-            goto cleanup;
+            return ret;
         }
         i++;
     }
 
- cleanup:
     return ret;
 }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v1 08/21] openvz_conf.c: remove unneeded cleanup label
Posted by Ján Tomko 6 years, 2 months ago
On Mon, Oct 21, 2019 at 03:18:58PM -0300, Daniel Henrique Barboza wrote:
>Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>---
> src/openvz/openvz_conf.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
>index 4646308c48..f12c91aa88 100644
>--- a/src/openvz/openvz_conf.c
>+++ b/src/openvz/openvz_conf.c
>@@ -873,12 +873,11 @@ openvzLocateConfDir(void)
>     while (conf_dir_list[i]) {
>         if (virFileExists(conf_dir_list[i])) {
>             ret = g_strdup(conf_dir_list[i]);
>-            goto cleanup;
>+            return ret;

This one does not need the ret variable at all, so I'm dropping this
patch.

>         }
>         i++;
>     }
>
>- cleanup:
>     return ret;
> }
>
>-- 
>2.21.0
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list