Signed-off-by: Bartosz Golaszewski <bgolaszew...@baylibre.com>
---
 src/hardware/baylibre-acme/protocol.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/hardware/baylibre-acme/protocol.c 
b/src/hardware/baylibre-acme/protocol.c
index 3ceee6c..24907fa 100644
--- a/src/hardware/baylibre-acme/protocol.c
+++ b/src/hardware/baylibre-acme/protocol.c
@@ -329,11 +329,10 @@ SR_PRIV int bl_acme_set_shunt(const struct 
sr_channel_group *cg, uint64_t shunt)
        fd = g_fopen(path->str, "w");
        if (!fd) {
                sr_err("Error opening %s: %s", path->str, strerror(errno));
-               g_string_free(path, TRUE);
-               return SR_ERR_IO;
+               ret = SR_ERR_IO;
+               goto out;
        }
 
-       g_string_free(path, TRUE);
        g_fprintf(fd, "%" PRIu64 "\n", MOHM_TO_UOHM(shunt));
        fclose(fd);
 
-- 
2.1.4


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to