baylibre-acme: Fix a double free in bl_acme_set_shunt().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
Bartosz Golaszewski 2015-03-18 14:26:43 +01:00 committed by Uwe Hermann
parent cfcdf57677
commit 350b8b07f0
1 changed files with 2 additions and 3 deletions

View 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"); fd = g_fopen(path->str, "w");
if (!fd) { if (!fd) {
sr_err("Error opening %s: %s", path->str, strerror(errno)); sr_err("Error opening %s: %s", path->str, strerror(errno));
g_string_free(path, TRUE); ret = SR_ERR_IO;
return SR_ERR_IO; goto out;
} }
g_string_free(path, TRUE);
g_fprintf(fd, "%" PRIu64 "\n", MOHM_TO_UOHM(shunt)); g_fprintf(fd, "%" PRIu64 "\n", MOHM_TO_UOHM(shunt));
fclose(fd); fclose(fd);