Signed-off-by: Bartosz Golaszewski <redacted>
fd = g_fopen(path->str, "w");
if (!fd) {
sr_err("Error opening %s: %s", path->str, strerror(errno));
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);
g_fprintf(fd, "%" PRIu64 "\n", MOHM_TO_UOHM(shunt));
fclose(fd);