提交 3ddfc55e 编写于 作者: R Richard Stanway

libobs: Fix missing mutex unlock from 26dbe548

上级 26dbe548
......@@ -359,6 +359,7 @@ int config_save(config_t *config)
FILE *f;
struct dstr str, tmp;
size_t i, j;
int ret = CONFIG_ERROR;
if (!config)
return CONFIG_ERROR;
......@@ -405,15 +406,15 @@ int config_save(config_t *config)
}
#ifdef _WIN32
if (fwrite("\xEF\xBB\xBF", 3, 1, f) != 1) {
fclose(f);
return CONFIG_ERROR;
}
if (fwrite("\xEF\xBB\xBF", 3, 1, f) != 1)
goto cleanup;
#endif
if (fwrite(str.array, str.len, 1, f) != 1) {
fclose(f);
return CONFIG_ERROR;
}
if (fwrite(str.array, str.len, 1, f) != 1)
goto cleanup;
ret = CONFIG_SUCCESS;
cleanup:
fclose(f);
pthread_mutex_unlock(&config->mutex);
......@@ -421,7 +422,7 @@ int config_save(config_t *config)
dstr_free(&tmp);
dstr_free(&str);
return CONFIG_SUCCESS;
return ret;
}
int config_save_safe(config_t *config, const char *temp_ext,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册