]> sigrok.org Git - libsigrok.git/commitdiff
baylibre-acme: Fix a double free in bl_acme_set_shunt().
authorBartosz Golaszewski <redacted>
Wed, 18 Mar 2015 13:26:43 +0000 (14:26 +0100)
committerUwe Hermann <redacted>
Fri, 20 Mar 2015 15:54:02 +0000 (16:54 +0100)
Signed-off-by: Bartosz Golaszewski <redacted>
src/hardware/baylibre-acme/protocol.c

index 461a7b5e4dc10392292a796bdacf9caf45f97a46..8769eefe7e662a259f9096fe093a6a71715f4d15 100644 (file)
@@ -328,11 +328,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);