--- projects/cms/source/ihost/libstatgrab/user_stats.c 2002/05/19 17:58:58 1.5 +++ projects/cms/source/ihost/libstatgrab/user_stats.c 2002/05/29 19:41:59 1.8 @@ -1,5 +1,6 @@ /* * i-scream central monitoring system + * http://www.i-scream.org.uk * Copyright (C) 2000-2002 i-scream * * This program is free software; you can redistribute it and/or @@ -17,6 +18,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ukcprog.h" #include #include @@ -80,8 +85,16 @@ char *get_user_stats(){ } #endif - if (user_list==NULL) user_list=strdup(""); - xml_user_data=strf("%s%d",user_list,nousers); + if (user_list==NULL){ + if((user_list=strdup("")) == NULL){ + errf("strdup failed (%m)"); + return NULL; + } + } + if((xml_user_data=strf("%s%d",user_list,nousers)) == NULL){ + errf("strf failed (%m)"); + return NULL; + } if (user_list!=NULL) free(user_list); return xml_user_data; }