From 46e4b4aee055c58265c77254b1dd085f17e3e859 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 14 May 2002 02:34:37 +0000 Subject: fix suggested by Ian Goldberg CVS patchset: 1884 CVS date: 2002/05/14 02:34:37 --- src/xine-utils/utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 61058b26b..d06341111 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: utils.c,v 1.5 2002/03/24 14:15:37 guenter Exp $ + * $Id: utils.c,v 1.6 2002/05/14 02:34:37 miguelfreitas Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -41,6 +41,10 @@ void *xine_xmalloc(size_t size) { void *ptr; + /* prevent xine_xmalloc(0) of possibly returning NULL */ + if( !size ) + size++; + if((ptr = malloc(size)) == NULL) { fprintf(stderr, "%s: malloc() failed: %s.\n", __XINE_FUNCTION__, strerror(errno)); -- cgit v1.2.3