Rocco Rutte:
[apps/madmutt.git] / lib.c
diff --git a/lib.c b/lib.c
index 1966fd6..2b15053 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -42,84 +42,6 @@ void mutt_nocurses_error (const char *fmt, ...)
   fputc ('\n', stderr);
 }
 
-void *safe_calloc (size_t nmemb, size_t size)
-{
-  void *p;
-
-  if (!nmemb || !size)
-    return NULL;
-
-  if (((size_t) - 1) / nmemb <= size) {
-    mutt_error _("Integer overflow -- can't allocate memory!");
-
-    sleep (1);
-    mutt_exit (1);
-  }
-
-  if (!(p = calloc (nmemb, size))) {
-    mutt_error _("Out of memory!");
-
-    sleep (1);
-    mutt_exit (1);
-  }
-  return p;
-}
-
-void *safe_malloc (size_t siz)
-{
-  void *p;
-
-  if (siz == 0)
-    return 0;
-  if ((p = (void *) malloc (siz)) == 0) {       /* __MEM_CHECKED__ */
-    mutt_error _("Out of memory!");
-
-    sleep (1);
-    mutt_exit (1);
-  }
-  return (p);
-}
-
-void safe_realloc (void *ptr, size_t siz)
-{
-  void *r;
-  void **p = (void **) ptr;
-
-  if (siz == 0) {
-    if (*p) {
-      free (*p);                /* __MEM_CHECKED__ */
-      *p = NULL;
-    }
-    return;
-  }
-
-  if (*p)
-    r = (void *) realloc (*p, siz);     /* __MEM_CHECKED__ */
-  else {
-    /* realloc(NULL, nbytes) doesn't seem to work under SunOS 4.1.x  --- __MEM_CHECKED__ */
-    r = (void *) malloc (siz);  /* __MEM_CHECKED__ */
-  }
-
-  if (!r) {
-    mutt_error _("Out of memory!");
-
-    sleep (1);
-    mutt_exit (1);
-  }
-
-  *p = r;
-}
-
-void safe_free (void *ptr)
-{
-  void **p = (void **) ptr;
-
-  if (*p) {
-    free (*p);                  /* __MEM_CHECKED__ */
-    *p = 0;
-  }
-}
-
 int safe_fclose (FILE ** f)
 {
   int r = 0;