X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fprotocol.c;h=8769eefe7e662a259f9096fe093a6a71715f4d15;hb=145d794facd93b182e6c85d7613ce2e6d9a66d48;hp=461a7b5e4dc10392292a796bdacf9caf45f97a46;hpb=5e23fcab889c62864b92aa3ad6902ce3e9f5be49;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index 461a7b5e..8769eefe 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -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);