summaryrefslogtreecommitdiff
path: root/src/sss_client
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-06-10 11:16:16 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-06-14 16:54:31 -0400
commit7d2f90122754a2b0ef21671d68a9fa98fbe8d4a8 (patch)
tree3a3f49bffbdf345ca90f9b900dd989c0228db6de /src/sss_client
parent1003dcd7681511c5b703e6723e207cdd50d82885 (diff)
downloadsssd-7d2f90122754a2b0ef21671d68a9fa98fbe8d4a8.tar.gz
sssd-7d2f90122754a2b0ef21671d68a9fa98fbe8d4a8.tar.bz2
sssd-7d2f90122754a2b0ef21671d68a9fa98fbe8d4a8.zip
Potential memory leak in _nss_sss_*_r()
Fixes: #516
Diffstat (limited to 'src/sss_client')
-rw-r--r--src/sss_client/group.c3
-rw-r--r--src/sss_client/passwd.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/sss_client/group.c b/src/sss_client/group.c
index e1b36e2a..60b4611c 100644
--- a/src/sss_client/group.c
+++ b/src/sss_client/group.c
@@ -235,6 +235,7 @@ enum nss_status _nss_sss_initgroups_dyn(const char *user, gid_t group,
*start += 1;
}
+ free(repbuf);
return NSS_STATUS_SUCCESS;
}
@@ -274,6 +275,7 @@ enum nss_status _nss_sss_getgrnam_r(const char *name, struct group *result,
/* only 1 result is accepted for this function */
if (((uint32_t *)repbuf)[0] != 1) {
*errnop = EBADMSG;
+ free(repbuf);
return NSS_STATUS_TRYAGAIN;
}
@@ -325,6 +327,7 @@ enum nss_status _nss_sss_getgrgid_r(gid_t gid, struct group *result,
/* only 1 result is accepted for this function */
if (((uint32_t *)repbuf)[0] != 1) {
*errnop = EBADMSG;
+ free(repbuf);
return NSS_STATUS_TRYAGAIN;
}
diff --git a/src/sss_client/passwd.c b/src/sss_client/passwd.c
index aa5c7602..95c7de61 100644
--- a/src/sss_client/passwd.c
+++ b/src/sss_client/passwd.c
@@ -208,6 +208,7 @@ enum nss_status _nss_sss_getpwnam_r(const char *name, struct passwd *result,
/* only 1 result is accepted for this function */
if (((uint32_t *)repbuf)[0] != 1) {
*errnop = EBADMSG;
+ free(repbuf);
return NSS_STATUS_TRYAGAIN;
}
@@ -259,6 +260,7 @@ enum nss_status _nss_sss_getpwuid_r(uid_t uid, struct passwd *result,
/* only 1 result is accepted for this function */
if (((uint32_t *)repbuf)[0] != 1) {
*errnop = EBADMSG;
+ free(repbuf);
return NSS_STATUS_TRYAGAIN;
}