]> granicus.if.org Git - libevent/commitdiff
s/http-server: fix cleanup routines
authorAzat Khuzhin <azat@libevent.org>
Mon, 28 Jan 2019 22:23:02 +0000 (01:23 +0300)
committerAzat Khuzhin <azat@libevent.org>
Mon, 28 Jan 2019 22:23:02 +0000 (01:23 +0300)
Fixes: bdd71f18 ("s/http-server: graceful cleanup")
sample/http-server.c

index e2fc849921b45a65d24ff3b16cce51e7801cf1d8..7537996891c5c2dd51d6402f8882a9e63f950dab 100644 (file)
@@ -435,6 +435,7 @@ main(int argc, char **argv)
        if (!handle) {
                fprintf(stderr, "couldn't bind to port %d. Exiting.\n", o.port);
                ret = 1;
+               goto err;
        }
 
        {
@@ -462,6 +463,7 @@ main(int argc, char **argv)
                        fprintf(stderr, "Weird address family %d\n",
                            ss.ss_family);
                        ret = 1;
+                       goto err;
                }
                addr = evutil_inet_ntop(ss.ss_family, inaddr, addrbuf,
                    sizeof(addrbuf));
@@ -472,6 +474,7 @@ main(int argc, char **argv)
                } else {
                        fprintf(stderr, "evutil_inet_ntop failed\n");
                        ret = 1;
+                       goto err;
                }
        }