From 20481e8d3b817d2f9c560aaf4a56581325ad1572 Mon Sep 17 00:00:00 2001 From: Arthur de Jong <arthur@arthurdejong.org> Date: Thu, 1 Feb 2007 21:13:25 +0000 Subject: get rid of xmalloc.[ch] git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@230 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/log.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nslcd/log.c') 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; -- cgit v1.2.3