46 lines
1.2 KiB
Diff
46 lines
1.2 KiB
Diff
|
|
From 1e6384ff431b3e3cc2dfeede2deb6a8aba154d13 Mon Sep 17 00:00:00 2001
|
||
|
|
From: huyan <hu.huyan@huawei.com>
|
||
|
|
Date: Mon, 17 Jun 2019 14:45:24 +0800
|
||
|
|
Subject: [PATCH] backport remove resource leaks from nfsidmap/libnfsidmap.c
|
||
|
|
|
||
|
|
---
|
||
|
|
support/nfsidmap/libnfsidmap.c | 10 ++++++++--
|
||
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c
|
||
|
|
index 35ddf01..7b8a871 100644
|
||
|
|
--- a/support/nfsidmap/libnfsidmap.c
|
||
|
|
+++ b/support/nfsidmap/libnfsidmap.c
|
||
|
|
@@ -406,8 +406,10 @@ int nfs4_init_name_mapping(char *conffile)
|
||
|
|
nfs4_methods = conf_get_list("Translation", "Method");
|
||
|
|
if (nfs4_methods) {
|
||
|
|
IDMAP_LOG(1, ("libnfsidmap: processing 'Method' list"));
|
||
|
|
- if (load_plugins(nfs4_methods, &nfs4_plugins) == -1)
|
||
|
|
+ if (load_plugins(nfs4_methods, &nfs4_plugins) == -1) {
|
||
|
|
+ conf_free_list(nfs4_methods);
|
||
|
|
return -ENOENT;
|
||
|
|
+ }
|
||
|
|
} else {
|
||
|
|
struct conf_list list;
|
||
|
|
struct conf_list_node node;
|
||
|
|
@@ -475,11 +477,15 @@ out:
|
||
|
|
if (ret) {
|
||
|
|
if (nfs4_plugins)
|
||
|
|
unload_plugins(nfs4_plugins);
|
||
|
|
- if (gss_plugins)
|
||
|
|
+ if (gss_plugins) {
|
||
|
|
unload_plugins(gss_plugins);
|
||
|
|
+ }
|
||
|
|
nfs4_plugins = gss_plugins = NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
+ if (gss_methods)
|
||
|
|
+ conf_free_list(gss_methods);
|
||
|
|
+
|
||
|
|
return ret ? -ENOENT: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
--
|
||
|
|
1.8.3.1
|
||
|
|
|