diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-01-12 23:32:24 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-01-12 23:32:24 +0100 |
commit | 388821aaf7ed45acdc47f7b1514bd76509bee627 (patch) | |
tree | 417d5f66096b78c868213586e65cefacfef6241f /nslcd/shadow.c | |
parent | cdae94613211057f57dec49e2f7e0afb9733951f (diff) |
check result of set_tolist() to ensure that memory allocation problems are logged
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1911 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/shadow.c')
-rw-r--r-- | nslcd/shadow.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nslcd/shadow.c b/nslcd/shadow.c index d940054..9a4f928 100644 --- a/nslcd/shadow.c +++ b/nslcd/shadow.c @@ -5,7 +5,7 @@ Copyright (C) 1997-2005 Luke Howard Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong + Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -104,6 +104,11 @@ void shadow_init(void) attmap_add_attributes(set, attmap_shadow_shadowExpire); attmap_add_attributes(set, attmap_shadow_shadowFlag); shadow_attrs = set_tolist(set); + if (shadow_attrs == NULL) + { + log_log(LOG_CRIT, "malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } set_free(set); } |