--- projects/libstatgrab/src/libstatgrab/tools.c 2004/04/06 17:55:16 1.45 +++ projects/libstatgrab/src/libstatgrab/tools.c 2004/04/07 09:44:08 1.46 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: tools.c,v 1.45 2004/04/06 17:55:16 ats Exp $ + * $Id: tools.c,v 1.46 2004/04/07 09:44:08 tdb Exp $ */ #ifdef HAVE_CONFIG_H @@ -45,6 +45,7 @@ #endif #include "tools.h" +#include "statgrab.h" #ifdef SOLARIS #ifdef HAVE_LIBDEVINFO_H @@ -501,5 +502,14 @@ int sg_drop_privileges() { if (setegid(getgid()) != 0) return -1; if (seteuid(getuid()) != 0) return -1; return 0; +} + +void *sg_realloc(void *ptr, size_t size) { + void *tmp = NULL; + tmp = realloc(ptr, size); + if(tmp == NULL) { + sg_set_error(SG_ERROR_MALLOC_FAILED, NULL); + } + return tmp; }