diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-02-13 08:39:00 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-02-13 11:54:53 -0500 |
commit | 5c8f19954c49a738b825d8752d25baf752723bea (patch) | |
tree | 15d379b73587aef82b6a71f99377ab6f7050f2dc /src/sss_client | |
parent | 4bea2cb840c0750835fba7c6af4619a9c699e374 (diff) | |
download | sssd-5c8f19954c49a738b825d8752d25baf752723bea.tar.gz sssd-5c8f19954c49a738b825d8752d25baf752723bea.tar.bz2 sssd-5c8f19954c49a738b825d8752d25baf752723bea.zip |
Fix missing NULL check after malloc
Coverity #12528
Diffstat (limited to 'src/sss_client')
-rw-r--r-- | src/sss_client/pam_sss.c | 4 |
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: |