There are a number of places where malloc+memset are used to initialize a chunk of memory that could be replaced with a call to calloc. Since we're not allocating large chunks of memory, there may not be huge performance wins from the swap, but it should condense the code a bit.
I acknowledge SF isn't gospel, but here's a quick blurb: https://stackoverflow.com/a/2688522