git-svn: trunk@4791
aCaB authored on 2009/02/16 01:52:46... | ... |
@@ -292,8 +292,10 @@ void nc_ping_entry(struct CP_ENTRY *cpe) { |
292 | 292 |
int s = nc_connect_entry(cpe); |
293 | 293 |
char *reply; |
294 | 294 |
|
295 |
- if (s!=-1 && !nc_send(s, "nPING\n", 6) && (reply = nc_recv(s))) { |
|
295 |
+ if(s>=0 && !nc_send(s, "nPING\n", 6) && (reply = nc_recv(s))) { |
|
296 | 296 |
cpe->dead = strcmp(reply, "PONG\n")!=0; |
297 |
+ free(reply); |
|
298 |
+ close(s); |
|
297 | 299 |
} else cpe->dead = 1; |
298 | 300 |
return; |
299 | 301 |
} |
... | ... |
@@ -312,6 +314,7 @@ int nc_connect_rand(int *main, int *alt, int *local) { |
312 | 312 |
return 1; |
313 | 313 |
} |
314 | 314 |
unlink(unlinkme); |
315 |
+ free(unlinkme); |
|
315 | 316 |
} else { |
316 | 317 |
char *reply=NULL, *port; |
317 | 318 |
int nport; |