From 388821aaf7ed45acdc47f7b1514bd76509bee627 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 12 Jan 2013 22:32:24 +0000 Subject: 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 --- nslcd/shadow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nslcd/shadow.c') 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); } -- cgit v1.2.3