jwerle / url.h

Parse URLs in C much like Node's url module.
55 stars 23 forks source link

Fix memory leaks found by valgrind — Warning: "%ms" requires POSIX-compliant libc #10

Closed RokerHRO closed 1 year ago

RokerHRO commented 1 year ago

I ran the test program on my Linux machine with valgrind and found a lot of memory leaks. They are also mentioned in issue #6

I fixed first the memory leaks in test.c itself, and in url.c afterwards.

Nota bene: I use now the %ms format specifier in sscanf() that is part of POSIX but not part of ISO C, so it might not work on MS Visual Studio, I guess. Perhaps these parts in the code should be changed if this is an issue.

Additionally, valgrind also found some other memory access violations, that are not (yet) fixed in my branch.