History

free buffers on send errors

Sigrid Solveig Haflínudóttir committed 2 years ago

Commit 692c0201 parent 2c1651b1 file · +13 −5Browse files

Unified · Split

9gc.c+13−5
@@ -343,7 +343,11 @@ registry(void) · 342 unmodified lines
343 if((a = srv(chatsrv)) != NULL){343 if((a = srv(chatsrv)) != NULL){
344 a->c.r = ctxchatR;344 a->c.r = ctxchatR;
345 c9version(&a->c, &tag, Msize);345 c9version(&a->c, &tag, Msize);
346 wrsend(a);346 if(wrsend(a) != 0){
347 free(a);
348 a = NULL;
349 continue;
350 }
347 return a;351 return a;
348 }352 }
349// }else{353// }else{
@@ -356,9 +360,13 @@ registry(void) · 6 unmodified lines
356 return NULL;360 return NULL;
357 a->c.r = ctxregistryR;361 a->c.r = ctxregistryR;
358 c9version(&a->c, &tag, Msize);362 c9version(&a->c, &tag, Msize);
359 wrsend(a);363 do{
360 while(c9proc(&a->c) == 0 && a->c.r == ctxregistryR)364 if(wrsend(a) != 0){
361 wrsend(a);365 free(a);
366 a = NULL;
367 break;
368 }
369 }while(c9proc(&a->c) == 0 && a->c.r == ctxregistryR);
362 370
363 return a;371 return a;
364}372}
@@ -474,7 +482,7 @@ main(int argc, char **argv) · 109 unmodified lines
474 for(;;){482 for(;;){
475 if((a = registry()) == NULL)483 if((a = registry()) == NULL)
476 return 1;484 return 1;
477 while (chatrw(a) == 0 && wrsend(a) == 0);485 while(chatrw(a) == 0 && wrsend(a) == 0);
478 if(a->flags & (Disconnected|Error)){486 if(a->flags & (Disconnected|Error)){
479 a->flags &= ~(Disconnected|Error);487 a->flags &= ~(Disconnected|Error);
480 skipuntil = chatoff;488 skipuntil = chatoff;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t