summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-02-13 08:39:00 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-13 11:54:56 -0500
commit83b62bf46ca5043f09a55a8b6c3c56d9da7932cd (patch)
tree4871681f7c1afe7e3ea9cd583e50651624c4d42a
parentf260d308b157bb3f27ea85a768d9f40dad65e60f (diff)
downloadsssd_unused-83b62bf46ca5043f09a55a8b6c3c56d9da7932cd.tar.gz
sssd_unused-83b62bf46ca5043f09a55a8b6c3c56d9da7932cd.tar.xz
sssd_unused-83b62bf46ca5043f09a55a8b6c3c56d9da7932cd.zip
Fix missing NULL check after malloc
Coverity #12528
-rw-r--r--src/sss_client/pam_sss.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
index a7eb6030..45e31810 100644
--- a/src/sss_client/pam_sss.c
+++ b/src/sss_client/pam_sss.c
@@ -972,6 +972,10 @@ static int eval_response(pam_handle_t *pamh, size_t buflen, uint8_t *buf,
free(pi->selinux_user);
}
pi->selinux_user = (char *)malloc(len + 1);
+ if (!pi->selinux_user) {
+ D(("Insufficient memory."));
+ return PAM_SYSTEM_ERR;
+ }
memcpy(pi->selinux_user, &buf[p], len + 1);
break;
default: