diff --git a/nfq2/darkmagic.c b/nfq2/darkmagic.c index 10f650e..55a96e4 100644 --- a/nfq2/darkmagic.c +++ b/nfq2/darkmagic.c @@ -1796,7 +1796,7 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf, char s[64]; snprintf(s,sizeof(s),"rawsend_sendto_divert: sendto (%zu)",len); DLOG_PERROR(s); - return false; + return -1; } return wr; diff --git a/nfq2/gzip.c b/nfq2/gzip.c index 38dd731..f47d26f 100644 --- a/nfq2/gzip.c +++ b/nfq2/gzip.c @@ -77,8 +77,16 @@ int z_readfile(FILE *F, char **buf, size_t *size, size_t extra_alloc) if (*size < bufsize) { - // free extra space - if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf; + if (*size + extra_alloc) + { + // free extra space + if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf; + } + else + { + free(*buf); + *buf = NULL; + } } inflateEnd(&zs);