4 ms·
I wasn't actually talking about error checking, I was talking about the lines: char *tok = (char *)malloc(SOMEMEMORY); tok = strtok(data, ":"); I don'
by jsolson 16y ago
I wasn't actually talking about error checking, I was talking about the lines:
char *tok = (char *)malloc(SOMEMEMORY);
tok = strtok(data, ":");
I don't actually care whether the malloc succeeded or whether or not he checked for an error, as the second line blows away the only reference to the potentially allocated memory. Whatever may or may not have been allocated has now officially been leaked.
- tptacek 16y agoThe cast on that malloc drives me f'ing nuts. DON'T CAST MALLOC.