diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-05-14 02:34:37 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-05-14 02:34:37 +0000 |
commit | 46e4b4aee055c58265c77254b1dd085f17e3e859 (patch) | |
tree | 47da19a15c75e6847f826dfc973761d018b6fc78 | |
parent | a2fa4c401c53db926d03bc8154c422ba9986ce08 (diff) | |
download | xine-lib-46e4b4aee055c58265c77254b1dd085f17e3e859.tar.gz xine-lib-46e4b4aee055c58265c77254b1dd085f17e3e859.tar.bz2 |
fix suggested by Ian Goldberg
CVS patchset: 1884
CVS date: 2002/05/14 02:34:37
-rw-r--r-- | src/xine-utils/utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)); |