Re: [PATCH 2/2] Fail reds_init_socket when getaddrinfo fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ack.

On 11/23/2012 01:18 PM, Christophe Fergeau wrote:
We currently output a warning when getaddrinfo fails, but then
we go on trying to use the information it couldn't read. Make
sure we bail out of reds_init_socket if getaddrinfo fails.
---
  server/reds.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/server/reds.c b/server/reds.c
index 5a03043..afa36d5 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2953,6 +2953,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
      if (rc != 0) {
          spice_warning("getaddrinfo(%s,%s): %s", addr, port,
                        gai_strerror(rc));
+        return -1;
      }

      for (e = res; e != NULL; e = e->ai_next) {

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]