Ai
1 Star 0 Fork 29

Wieder/procps-ng

forked from src-openEuler/procps-ng
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0011-pgrep-Remove-memory-leak.patch 717 Bytes
一键复制 编辑 原始数据 按行查看 历史
EulerOSWander 提交于 2021-02-27 15:16 +08:00 . Sync patches from upstream
From 5f859b30d34c3e1ec3fca48d55248b502669fcc5 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Tue, 22 Dec 2020 16:08:49 +1100
Subject: [PATCH] pgrep: Remove memory leak
This is part of !118 where @tt.rantala found a memory leak.
The other part of !118 may come later if the performance change
is significant.
References:
procps-ng/procps!118
---
pgrep.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pgrep.c b/pgrep.c
index 205a1db..4fe5e8a 100644
--- a/pgrep.c
+++ b/pgrep.c
@@ -716,6 +716,11 @@ static struct el * select_procs (int *num)
free(cmdsearch);
free(cmdoutput);
+ if (preg) {
+ regfree(preg);
+ free(preg);
+ }
+
return list;
}
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wieder/procps-ng.git
git@gitee.com:wieder/procps-ng.git
wieder
procps-ng
procps-ng
master

搜索帮助