strdup dumping core on passing NULL

Viewed 13071

strdup(null) dumps core.

Tried in on ubuntu and freeBSD both.

why? Shouldn't it return null?

char *b = NULL;
a = strdup(b);

This will dump core on strdup call.

4 Answers
Related