make sure malloc didn't return nil

This commit is contained in:
jsorg71 2007-07-26 05:40:27 +00:00
parent 422bbf3a89
commit f82cf80d4f
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@ g_malloc(int size, int zero)
rv = (char*)malloc(size);
if (zero)
{
memset(rv, 0, size);
if (rv != 0)
{
memset(rv, 0, size);
}
}
return rv;
}