13 Star 0 Fork 9

ocs-commit/fontconfig

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ec20037908963870e27572fadef766cc8a6d9818.patch 876 Bytes
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-12-31 10:13 +08:00 . - [Type] bugfix
From ec20037908963870e27572fadef766cc8a6d9818 Mon Sep 17 00:00:00 2001
From: Kenny Levinsen <kl@kl.wtf>
Date: Tue, 12 Nov 2024 10:39:49 +0100
Subject: [PATCH] Unlock on allocation failure in FcCacheInsert
If an allocation error occurred during FcCacheInsert, the function would
return without unlocking the cache lock, deadlocking all future
interactions with the cache.
Unlock the cache on allocation failure.
---
src/fccache.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/fccache.c b/src/fccache.c
index e74dada6..f5c41aeb 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -586,7 +586,10 @@ FcCacheInsert (FcCache *cache, struct stat *cache_stat)
s = malloc (sizeof (FcCacheSkip) + (level - 1) * sizeof (FcCacheSkip *));
if (!s)
+ {
+ unlock_cache ();
return FcFalse;
+ }
s->cache = cache;
s->size = cache->size;
--
GitLab
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit/fontconfig.git
git@gitee.com:ocs-commit/fontconfig.git
ocs-commit
fontconfig
fontconfig
master

搜索帮助