Re: [AD] fixes.. malloc()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


[lots of unchecked mallocs]

May I suggest you to prepare patches in order to properly check these 
unchecked mallocs ?

The pattern is either:

 m = malloc(size);
 if (!m) {
    *allegro_errno = ENOMEM;
    /* code for freeing used resources */
   return;
 }

or 

 m = malloc(size);
 if (!m) {
    *allegro_errno = ENOMEM;
    goto Exit;
 }

....

Exit:
 /* common code for freeing used resources */
 return;

-- 
Eric Botcazou



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/