Changeset 224

Show
Ignore:
Timestamp:
04/22/08 04:38:54 (7 months ago)
Author:
conrad
Message:

Fix for malloc wrapper, from Yair K. (accidentally dropped from
last patch):
malloc(0) returns NULL on glibc. So if size==0, xs_malloc will exit
with "malloc error". Make sure instead that at least one byte is
allocated. At the moment, This can only happen if INCR returns
*value == 0, which I'm not sure is legal.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • xsel/trunk/xsel.c

    r223 r224  
    266266  void * ret; 
    267267 
     268  if (size == 0) size = 1; 
    268269  if ((ret = malloc (size)) == NULL) { 
    269270    exit_err ("malloc error");