diff options
author | Linus Nordberg <linus@nordu.net> | 2011-03-14 00:22:41 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2011-03-14 00:22:41 +0100 |
commit | 1addbfaaa594aa34daf5a38ce0038ec74e878d7c (patch) | |
tree | 5a5429cf99fabefa1804194ad59fd9f004561ad6 /lib | |
parent | a36004c2baa34b4933af3115f920d3904857e19f (diff) |
Don't free connection on error, just close it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/conn.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -20,11 +20,12 @@ int conn_close (struct rs_connection **connp) { - int r; + int r = 0; assert (connp); assert (*connp); - r = rs_conn_destroy (*connp); - if (!r) + if ((*connp)->is_connected) + r = rs_conn_disconnect (*connp); + if (r == RSE_OK) *connp = NULL; return r; } |