From b10d5cccee5d2945b1924a732a9b7d9d79d91b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 14 Apr 2007 17:12:05 +0200 Subject: Add a xine_xcalloc function to wrap around calloc(), to improve security from now on. --- src/xine-utils/xineutils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/xine-utils/xineutils.h') diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 03c5f689a..20c3cb2dc 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -630,6 +630,12 @@ void *xine_xmalloc(size_t size) XINE_PROTECTED; void *xine_xmalloc(size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED; #endif +#if !defined(__GNUC__) || __GNUC__ < 3 +void *xine_xcalloc(size_t nmemb, size_t size) XINE_PROTECTED; +#else +void *xine_xcalloc(size_t nmemb, size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED; +#endif + /* * Same as above, but memory is aligned to 'alignement'. * **base is used to return pointer to un-aligned memory, use -- cgit v1.2.3