MIGRATE: fix fd leak due to missing close on error.

This commit is contained in:
antirez
2012-11-12 18:56:29 +01:00
parent 5a8234d2c9
commit ae3aeca828

View File

@ -158,6 +158,7 @@ void migrateCommand(redisClient *c) {
return; return;
} }
if ((aeWait(fd,AE_WRITABLE,timeout*1000) & AE_WRITABLE) == 0) { if ((aeWait(fd,AE_WRITABLE,timeout*1000) & AE_WRITABLE) == 0) {
close(fd);
addReplySds(c,sdsnew("-IOERR error or timeout connecting to the client\r\n")); addReplySds(c,sdsnew("-IOERR error or timeout connecting to the client\r\n"));
return; return;
} }