In particular, fclose() all the files we fopen(). From Debian [1]. [1] http://sources.debian.net/src/wmget/0.6.0-5/debian/patches/ fix_resource_leaks.patch/
In particular, use intptr_t instead of int. From the Debian patch [1]. [1] http://sources.debian.net/src/wmget/0.6.0-5/debian/patches/ fix_-Wpointer-to-int-cast.patch/
Obtained from [1]. [1] http://amtrickey.net/download/wmget-0.6.0-src.tar.gz