Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/log.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-02-01 22:13:25 +0100
committerArthur de Jong <arthur@arthurdejong.org>2007-02-01 22:13:25 +0100
commit20481e8d3b817d2f9c560aaf4a56581325ad1572 (patch)
tree2c4ede05db9ab09e93cbc9f00953830766deaf13 /nslcd/log.c
parent5fc5a1bf89cd6c76be869fc09eb83197efdd2335 (diff)
get rid of xmalloc.[ch]
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@230 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/log.c')
-rw-r--r--nslcd/log.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nslcd/log.c b/nslcd/log.c
index 0420a45..d5f89de 100644
--- a/nslcd/log.c
+++ b/nslcd/log.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <syslog.h>
@@ -31,7 +32,6 @@
#include <string.h>
#include "log.h"
-#include "xmalloc.h"
/* set the logname */
@@ -63,7 +63,13 @@ static void log_addlogging_fp(FILE *fp,int loglevel)
{
struct cvsd_log *tmp,*lst;
/* create new logstruct */
- tmp=(struct cvsd_log *)xmalloc(sizeof(struct cvsd_log));
+ tmp=(struct cvsd_log *)malloc(sizeof(struct cvsd_log));
+ if (tmp==NULL)
+ {
+ fprintf(stderr,"malloc() failed: %s",strerror(errno));
+ /* since this is done during initialisation it's best to bail out */
+ exit(1);
+ }
tmp->fp=fp;
tmp->loglevel=loglevel;
tmp->next=NULL;