summaryrefslogtreecommitdiff
path: root/support/nfsidmap
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2019-04-28 14:01:38 -0400
committerSteve Dickson <steved@redhat.com>2019-05-10 10:53:33 -0400
commit151352bd59365c4d07b9bc7413a0bfd2a3bdfb91 (patch)
treef6da34653105ef01032eed0ce8d0046e21e81f2e /support/nfsidmap
parent53f6d22014c0928bf3fcfba4ae5078ca9188f116 (diff)
downloadnfs-utils-151352bd59365c4d07b9bc7413a0bfd2a3bdfb91.tar.gz
Removed resource leaks from nfsidmap/static.c
nfsidmap/static.c:350: leaked_storage: Variable "princ_list" going out of scope leaks the storage it points to. nfsidmap/static.c:358: leaked_storage: Variable "princ_list" going out of scope leaks the storage it points to. nfsidmap/static.c:360: leaked_storage: Variable "unode" going out of scope leaks the storage it points to. nfsidmap/static.c:382: leaked_storage: Variable "princ_list" going out of scope leaks the storage it points to. nfsidmap/static.c:390: leaked_storage: Variable "gnode" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfsidmap')
-rw-r--r--support/nfsidmap/static.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/support/nfsidmap/static.c b/support/nfsidmap/static.c
index f7b8a67..8ac4a39 100644
--- a/support/nfsidmap/static.c
+++ b/support/nfsidmap/static.c
@@ -347,6 +347,7 @@ static int static_init(void) {
warnx("static_init: calloc (1, %lu) failed",
(unsigned long)sizeof *unode);
free(pw);
+ conf_free_list(princ_list);
return -ENOMEM;
}
unode->uid = pw->pw_uid;
@@ -355,6 +356,9 @@ static int static_init(void) {
unode->localname = conf_get_str("Static", cln->field);
if (!unode->localname) {
free(pw);
+ free(unode->principal);
+ free(unode);
+ conf_free_list(princ_list);
return -ENOENT;
}
@@ -379,6 +383,7 @@ static int static_init(void) {
warnx("static_init: calloc (1, %lu) failed",
(unsigned long)sizeof *gnode);
free(gr);
+ conf_free_list(princ_list);
return -ENOMEM;
}
gnode->gid = gr->gr_gid;
@@ -387,6 +392,9 @@ static int static_init(void) {
gnode->localgroup = conf_get_str("Static", cln->field);
if (!gnode->localgroup) {
free(gr);
+ free(gnode->principal);
+ free(gnode);
+ conf_free_list(princ_list);
return -ENOENT;
}
@@ -394,6 +402,8 @@ static int static_init(void) {
LIST_INSERT_HEAD (&gid_mappings[gid_hash(gnode->gid)], gnode, link);
}
+
+ conf_free_list(princ_list);
return 0;
}