On 2/5/18 8:34 AM, Serhey Popovych wrote: > Sorry David, but I do no see problem with this function right now: > > 1. It allocates string using malloc() in asprintf() > 2. free() it *after* fopen() to prevent memory leak if fopen() fails > 3. or if fopen() succeeded and we fscanf() with %ms that will allcate > buffer we return. > > I agree this is GNU extensions, but it does not look as user after free > to me. Should I get rid of these extensions? They are not last as I can > find. >
ok, I missed the 'm' in the %ms of the fscanf. Thanks for checking.