]> git.saurik.com Git - redis.git/blobdiff - src/migrate.c
MIGRATE: fix fd leak due to missing close on error.
[redis.git] / src / migrate.c
index 94aa1e40db664a2d09b97f0b0afb3a11a7ed4f08..86dfe165b9ba4d18a6c3fe081ea79bba97d8dece 100644 (file)
@@ -158,6 +158,7 @@ void migrateCommand(redisClient *c) {
         return;
     }
     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"));
         return;
     }