Skip to content

Commit 847e689

Browse files
author
bol-van
committed
AI fixes
1 parent 2875270 commit 847e689

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

nfq2/darkmagic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
17961796
char s[64];
17971797
snprintf(s,sizeof(s),"rawsend_sendto_divert: sendto (%zu)",len);
17981798
DLOG_PERROR(s);
1799-
return false;
1799+
return -1;
18001800
}
18011801

18021802
return wr;

nfq2/gzip.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,16 @@ int z_readfile(FILE *F, char **buf, size_t *size, size_t extra_alloc)
7777

7878
if (*size < bufsize)
7979
{
80-
// free extra space
81-
if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf;
80+
if (*size + extra_alloc)
81+
{
82+
// free extra space
83+
if ((newbuf = realloc(*buf, *size + extra_alloc))) *buf = newbuf;
84+
}
85+
else
86+
{
87+
free(*buf);
88+
*buf = NULL;
89+
}
8290
}
8391

8492
inflateEnd(&zs);

0 commit comments

Comments
 (0)