summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-14 00:22:41 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-14 00:22:41 +0100
commit1addbfaaa594aa34daf5a38ce0038ec74e878d7c (patch)
tree5a5429cf99fabefa1804194ad59fd9f004561ad6 /lib
parenta36004c2baa34b4933af3115f920d3904857e19f (diff)
Don't free connection on error, just close it.
Diffstat (limited to 'lib')
-rw-r--r--lib/conn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/conn.c b/lib/conn.c
index f85eec6..58290f5 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -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;
}