make sure malloc didn't return nil
This commit is contained in:
parent
422bbf3a89
commit
f82cf80d4f
@ -84,9 +84,12 @@ g_malloc(int size, int zero)
|
|||||||
|
|
||||||
rv = (char*)malloc(size);
|
rv = (char*)malloc(size);
|
||||||
if (zero)
|
if (zero)
|
||||||
|
{
|
||||||
|
if (rv != 0)
|
||||||
{
|
{
|
||||||
memset(rv, 0, size);
|
memset(rv, 0, size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user