You do not need to initialize a NULL value. If you intend to highlight it immediately, you can skip it.
In may be useful for error handling, as in the following example. In this case, the gap to the end after pplacement would be left quninitialized.
int func(void)
{
char *p;
char *q;
p = malloc(100);
if (!p)
goto end;
q = malloc(100);
if (!q)
goto end;
end:
free(p);
free(q);
return 0;
}
In addition, and this is my personal taste, always highlight structures using calloc. Lines can be selected uninitialized withmalloc
eyalm source
share