Btw, it's not a typo. When I write if (result != NULL) free (result);
it's either - because it makes the logic clearer (you have to think less when you want to verify that the code is correct), or - an attempt to not assume too much from a system function, or - an optimization that avoids an unnecessary function call. Bruno