Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes to Malloc() and Free() in mojoshader_opengl.c ...
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 27, 2008
1 parent ef395e1 commit fd772ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mojoshader_opengl.c
Expand Up @@ -86,12 +86,16 @@ static void internal_free(void *ptr, void *d) { free(ptr); }

static inline void *Malloc(const size_t len)
{
return malloc_fn(len, malloc_data);
void *retval = malloc_fn(len, malloc_data);
if (retval == NULL)
set_error("out of memory");
return retval;
} // Malloc

static inline void Free(void *ptr)
{
return free_fn(ptr, malloc_data);
if (ptr != NULL)
free_fn(ptr, malloc_data);
} // Free


Expand Down

0 comments on commit fd772ac

Please sign in to comment.