projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make cs_get_ssl return 0 if GNU TLS is enabled.
[yaz-moved-to-github.git]
/
src
/
xmalloc.c
diff --git
a/src/xmalloc.c
b/src/xmalloc.c
index
d48daa4
..
d5d6dad
100644
(file)
--- a/
src/xmalloc.c
+++ b/
src/xmalloc.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
- * All rights reserved.
- *
- * $Id: xmalloc.c,v 1.7 2006-04-21 10:28:07 adam Exp $
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
+ * See the file LICENSE for details.
*/
/**
* \file xmalloc.c
*/
/**
* \file xmalloc.c
@@
-246,6
+244,11
@@
void xmalloc_trav_f(const char *s, const char *file, int line)
xmalloc_trav_d(file, line);
}
xmalloc_trav_d(file, line);
}
+void xmalloc_fatal(void)
+{
+ exit(1);
+}
+
void *xrealloc_f (void *o, size_t size, const char *file, int line)
{
void *p = xrealloc_d (o, size, file, line);
void *xrealloc_f (void *o, size_t size, const char *file, int line)
{
void *p = xrealloc_d (o, size, file, line);
@@
-263,7
+266,7
@@
void *xrealloc_f (void *o, size_t size, const char *file, int line)
{
yaz_log (YLOG_FATAL|YLOG_ERRNO, "Out of memory, realloc (%ld bytes)",
(long) size);
{
yaz_log (YLOG_FATAL|YLOG_ERRNO, "Out of memory, realloc (%ld bytes)",
(long) size);
- exit(1);
+ xmalloc_fatal();
}
return p;
}
}
return p;
}
@@
-286,7
+289,7
@@
void *xmalloc_f (size_t size, const char *file, int line)
{
yaz_log (YLOG_FATAL, "Out of memory - malloc (%ld bytes)",
(long) size);
{
yaz_log (YLOG_FATAL, "Out of memory - malloc (%ld bytes)",
(long) size);
- exit (1);
+ xmalloc_fatal();
}
return p;
}
}
return p;
}
@@
-308,7
+311,7
@@
void *xcalloc_f (size_t nmemb, size_t size, const char *file, int line)
{
yaz_log (YLOG_FATAL, "Out of memory - calloc (%ld, %ld)",
(long) nmemb, (long) size);
{
yaz_log (YLOG_FATAL, "Out of memory - calloc (%ld, %ld)",
(long) nmemb, (long) size);
- exit (1);
+ xmalloc_fatal();
}
return p;
}
}
return p;
}