agent: Fix error handling in map_supervised_sockets
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Wed, 5 Oct 2016 04:23:11 +0000 (00:23 -0400)
committerWerner Koch <wk@gnupg.org>
Wed, 5 Oct 2016 06:11:53 +0000 (08:11 +0200)
* agent/gpg-agent.c (map_supervised_sockets): the file descriptor to
  close on error is fd, not i.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
agent/gpg-agent.c

index 1696e5a..9c7b8fc 100644 (file)
@@ -758,14 +758,14 @@ map_supervised_sockets (gnupg_fd_t *r_fd,
                         {
                           log_error ("cannot listen on fd %d for %s socket\n",
                                      fd, tbl[j].label);
-                          close (i);
+                          close (fd);
                         }
                     }
                   else
                     {
                       log_error ("cannot listen on more than one %s socket\n",
                                  tbl[j].label);
-                      close (i);
+                      close (fd);
                     }
                   break;
                 }