代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/kmod 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 47807c4cfa5ffe1e5da27e3d3056d9b47ba998c5 Mon Sep 17 00:00:00 2001
From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Date: Sun, 29 Nov 2020 18:47:35 +0200
Subject: [PATCH] libkmod: kmod_builtin_get_modinfo: free modinfo on error
reason:kmod_builtin_get_modinfo: free modinfo on error
Conflict:NA
Reference:https://lore.kernel.org/linux-modules/CAKi4VA+kaWfLZ_Ue-teaJAvDQjfM6G-WK3KmMWVinR-Zg6T64A@mail.gmail.com/T/#t
The function allocates array but on building it if get_string()
fails it returns the error leaving the array allocated. The caller
does not care about it in error case either.
Free it to fix memory leak.
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---
libkmod/libkmod-builtin.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c
index aaec5dd..fc9a376 100644
--- a/libkmod/libkmod-builtin.c
+++ b/libkmod/libkmod-builtin.c
@@ -314,6 +314,7 @@ ssize_t kmod_builtin_get_modinfo(struct kmod_ctx *ctx, const char *modname,
offset = get_string(iter, pos, &line, &linesz);
if (offset <= 0) {
count = (offset) ? -errno : -EOF;
+ free(*modinfo);
goto fail;
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。