From 2e8595f17ffe84248a749e34a52dbea4815082e5 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 3 Apr 2009 19:46:32 +0000 Subject: [PATCH] Fix: caput quits when connection fails (catools) --- src/catools/caput.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/catools/caput.c b/src/catools/caput.c index bf0fc7977..02cb6185c 100644 --- a/src/catools/caput.c +++ b/src/catools/caput.c @@ -379,7 +379,11 @@ int main (int argc, char *argv[]) pvs[0].name = argv[optind] ; /* Copy PV name from command line */ - connect_pvs(pvs, nPvs); + result = connect_pvs(pvs, nPvs); /* If the connection fails, we're done */ + if (result) { + ca_context_destroy(); + return result; + } /* Get values from command line */ optind++;