diff options
author | Steve Dickson <steved@redhat.com> | 2019-04-28 13:56:52 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2019-04-28 13:56:52 -0400 |
commit | 4979b1ee19adc67800870aa5085fa4624ce0cf91 (patch) | |
tree | 49763be8cf8b38b0ec10e153b890a96d9613c289 | |
parent | 86d0ca3ad8c9594875791546557f68032c69146f (diff) | |
download | nfs-utils-4979b1ee19adc67800870aa5085fa4624ce0cf91.tar.gz |
Removed resource leaks from nfsidmap/libnfsidmap.c
nfsidmap/libnfsidmap.c:410: leaked_storage: Variable "nfs4_methods"
going out of scope leaks the storage it points to.
ibnfsidmap.c:483: leaked_storage: Variable "gss_methods"
going out of scope leaks the storage it points to.
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | support/nfsidmap/libnfsidmap.c | 10 |
1 files 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; } |