char *str = malloc(1000); // that is ok
// do somthing ...
free(str);
//but what if i didn't protect malloc from failure
// i mean doing that
char *str = malloc(1000);
if (!str)
return (0);
//do something ...
free (str);
so how can malloc
fail on reserving memory in heap
and what is the error that can happened