From 2ed48152b02a273b899d6a8fb562d949aa5121b8 Mon Sep 17 00:00:00 2001 From: dmaas Date: Mon, 7 Apr 2003 22:23:20 +0000 Subject: [PATCH] new_handle_on_port() error path fix from Jim Radford git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@105 53a565d1-3bb7-0310-b661-cf11e63c67ab --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 018943d..3d611bc 100644 --- a/src/main.c +++ b/src/main.c @@ -411,8 +411,10 @@ raw1394handle_t raw1394_new_handle_on_port(int port) return NULL; tryagain: - if (raw1394_get_port_info(handle, NULL, 0) < 0) + if (raw1394_get_port_info(handle, NULL, 0) < 0) { + raw1394_destroy_handle(handle); return NULL; + } if (raw1394_set_port(handle, port)) { if (errno == ESTALE || errno == EINTR) {