Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00
This commit is contained in:
bol-van
2026-02-17 09:35:09 +03:00
parent 287527092a
commit 847e689bfb
2 changed files with 11 additions and 3 deletions

View File

@@ -1796,7 +1796,7 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
char s[64]; char s[64];
snprintf(s,sizeof(s),"rawsend_sendto_divert: sendto (%zu)",len); snprintf(s,sizeof(s),"rawsend_sendto_divert: sendto (%zu)",len);
DLOG_PERROR(s); DLOG_PERROR(s);
return false; return -1;
} }
return wr; return wr;

View File

@@ -76,10 +76,18 @@ int z_readfile(FILE *F, char **buf, size_t *size, size_t extra_alloc)
} while (r == Z_OK); } while (r == Z_OK);
if (*size < bufsize) if (*size < bufsize)
{
if (*size + extra_alloc)
{ {
// free extra space // free extra space
if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf; if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf;
} }
else
{
free(*buf);
*buf = NULL;
}
}
inflateEnd(&zs); inflateEnd(&zs);
return r; return r;