diff options
author | Sebastian Geerken <devnull@localhost> | 2013-01-02 20:18:06 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-01-02 20:18:06 +0100 |
commit | 4371834b825361650d6d2b48ec47bb258dccaa6d (patch) | |
tree | f24b6ba61f19eda10e018220b785c13ea12cb179 /test | |
parent | 2a3e6330ae2c4a7537dd6b1c8668051f0670746c (diff) | |
parent | 541948d93d7ab1f1d812f801811057e2e2e6d09b (diff) |
Merge with main repo.
Diffstat (limited to 'test')
-rw-r--r-- | test/cookies.c | 4 | ||||
-rw-r--r-- | test/liang.cc | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/cookies.c b/test/cookies.c index 5461e77e..1036779f 100644 --- a/test/cookies.c +++ b/test/cookies.c @@ -392,7 +392,7 @@ static int Dpi_connect_socket(const char *server_name) } else if (connect(sock_fd, (void*)&sin, sizeof(sin)) == -1) { MSG("[dpi::connect] errno:%d %s\n", errno, dStrerror(errno)); - /* send authentication Key (the server closes sock_fd on error) */ + /* send authentication Key (the server closes sock_fd on auth error) */ } else if (!(cmd = a_Dpip_build_cmd("cmd=%s msg=%s", "auth", SharedKey))) { MSG_ERR("[Dpi_connect_socket] Can't make auth message.\n"); } else if (Dpi_blocking_write(sock_fd, cmd, strlen(cmd)) == -1) { @@ -401,6 +401,8 @@ static int Dpi_connect_socket(const char *server_name) ret = sock_fd; } dFree(cmd); + if (sock_fd != -1 && ret == -1) /* can't send cmd? */ + Dpi_close_fd(sock_fd); return ret; } diff --git a/test/liang.cc b/test/liang.cc index a1bc2442..ce5036fa 100644 --- a/test/liang.cc +++ b/test/liang.cc @@ -18,7 +18,7 @@ void hyphenateWord (dw::core::Platform *p, const char *word) } putchar ('\n'); if (breakPos) - delete breakPos; + free (breakPos); } int main (int argc, char *argv[]) |