Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit831195d

Browse files
committed
Add a condition to prevend freeing NULL msg when dropping a client that hasn't sent anything yet.
1 parentd0f060a commit831195d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎contrib/raftable/t/000_basic.pl‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ sub start_nodes
7171
$able->psql('postgres',"select raftable('hello', '$tests{hello}');");
7272
$baker->psql('postgres',"select raftable('and', '$tests{and}');");
7373
$charlie->psql('postgres',"select raftable('goodbye', '$tests{goodbye}');");
74-
#$baker->stop;
74+
$baker->stop;
7575
$able->psql('postgres',"select raftable('world', '$tests{world}');");
7676

77-
#$baker->start;
77+
$baker->start;
78+
sleep(5);
7879
while (my ($key,$value) =each(%tests))
7980
{
8081
my$o =$baker->psql('postgres',"select raftable('$key');");

‎contrib/raftable/worker.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static bool remove_client(Client *c)
169169
intsock=c->sock;
170170
Assert(sock >=0);
171171
c->sock=-1;
172-
pfree(c->msg);
172+
if (c->msg)pfree(c->msg);
173173

174174
server.clientnum--;
175175
close(sock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp